gpk@bell-labs.com: [Python-bugs-list] netrc module has bad error handling (PR#265)
Eric S. Raymond
esr@thyrsus.com
Tue, 4 Apr 2000 08:23:00 -0400
lannert@lannert.rz.uni-duesseldorf.de <lannert@lannert.rz.uni-duesseldorf.de>:
> "Eric S. Raymond" wrote:
> > > > BTW, the following lines:
> > > >
> > > > 31: lexer.whitepace = ' \t'
> > > > 35: lexer.whitepace = ' \t\r\n'
> > > >
> > > > look a bit strange; shouldn't it be "whitespace" as defined in shlex?
> > > > (But then, how did this ever work? :)
> >
> > This code is correct, though perhaps not as explicit as it should be.
> >
> > It is a workaround for the fact that macdefs actually have different
> > lexical rules than the rest of the .netrc format. If you notice that
> > the assignment on line 35 is actually restoring the shlex default I
> > think you'll grok what's happening.
> >
> > It's kind of ugly, but that's not my fault :-). Go pound on whoever
> > designed the .netrc format.
>
> I'm afraid I didn't make my point clear enough -- isn't "whitepace" a
> misspelling for "whitespace"? If not, I'd suggest using a much
> different name ... The workaround to cope with a strange file format
> is certainly legitimate! ;-)
Zounds. You're right, this can't have worked. I guess nobody has tried to
parse macdefs yet!
--
<a href="http://www.tuxedo.org/~esr">Eric S. Raymond</a>
Love your country, but never trust its government.
-- Robert A. Heinlein.