shebang strange thing...
Gilles Lenfant
glenfant at NOSPAM.bigfoot.com
Mon Jun 23 06:49:37 EDT 2003
"Mel Wilson" <mwilson at the-wire.com> a écrit dans le message de news:
yKH9+ks/KvvV089yn at the-wire.com...
> In article <uZSIa.534$sF6.54902840 at newssvr21.news.prodigy.com>,
> Van Gale <news at exultants.org> wrote:
> >Erik Max Francis wrote:
> >> Van Gale wrote:
> >>>There's a very subtle bug (feature?) in bash (and maybe other shells?)
> >>>that will generate this error if the line is terminated with a CR/LF
> >>>pair instead of just a linefeed.
> >> Yes, it's common to other shells. It's not a feature, but it's not a
> >> "bug" per se -- using CR LF terminated text files on Unix is operator
> >> error.
>
> >Well guess what, it happens. It even happens when the "operator" is
> >aware of the problem. So lets not call it a bug, and instead call it
> >poor programming because the error message is not only incorrect, but
> >will also waste a fair amount of time of someone trying to debug the
> >problem because it points them in the wrong direction.
>
> It's understandable once you realize that the shell
> thinks the '\r' is part of the filename. Just like
>
> os.execv ('/usr/bin/python\r', ('myfile.py',))
>
> Regards. Mel.
IMHO, it's "buggy" :
* most unix/windows/macos modern tools accept any end of line mark, like
Python does.
* the errror message points the user to a bad direction.
--Gilles
More information about the Python-list
mailing list