python 2.0 won't run scripts with \r\n line termination on RH7?

Mike Carifio carifio.nospam at nospam.usys.com
Mon Feb 12 11:32:54 EST 2001


Insightful responses.

Mr. Rabak suggested convincing Samba to convert the end of line
characteristics.
A good suggestion, but one that the Samba team decided against for several
versions.
They contend that they shouldn't fool with the insides of files. I tend to
agree with them.
In any event, its not in version 2.0.7.

So here's my solution, crufty though it is. I created a link to the python
executable
named 'python^M', in other words I added the carriage return to the end of
the file name
so bash would find it. (In bash, Ctrl-V inserts the next character as a
literal.) This way, I
don't have to worry about whether I created the file on Linux or NT. Umm,
that's not really
true, but I don't have to worry about line termination for invocation.
That's a start.

This "solution" unfortunately doesn't handle options, for example:

    #!/usr/local/bin/python -i
    print "some stuff"

doesn't work.

Thanks for help.






More information about the Python-list mailing list