PythonWin 2 UNIX

Steve Holden sholden at holdenweb.com
Fri Apr 6 08:02:31 EDT 2001


"Mark Hammond" <MarkH at ActiveState.com> wrote ...
> Steve Holden wrote:
>
> > "dsavitsk" <dsavitsk at e-coli.net> wrote in message
>
> > Just to revisit: the only problem I have heard about CRLF causing was in
the
> > #!, where the CR will be taken as part of the program name, and the
Python
> > interpreter file will not be found. Are you saying that UNIX flavours
cannot
> > ignore a carriage return? If so, it would be interesting to see such
syntax
> > error report.
>
>  >>> compile("print 1\n", "<string>", "exec")
> <code object ? at 012BBA20, file "<string>", line 1>
>  >>> compile("print 1\r\n", "<string>", "exec")
> Traceback (most recent call last):
> ...

Blerch. Sorry, Mark, I could have tried that myself. Does anyone agree with
me that this is a serious blot on the landscape which should be removed in
2.2 and onwards?

How about

    from __future__ import carriage_return_is_ignored

Just joking. But surely any sensible language processor could, and should,
treat CR as whitespace without in any way damaging its concept of what a
line is. I can see possible problems with multi-line string literals, but
they aren't parsed in the same way as other tokens anyway, right?

still-won't-stop-#!name<CR>-from-not-executing-ly y'rs  - steve







More information about the Python-list mailing list