Diez B. Roggisch wrote: > Mark Tarver wrote: > >> I have a very strange error. I have two test python files test.py and >> python.py which contain the following code >> >> #!/usr/bin/python >> print "Content-type: text/html" >> print >> print "<html>" >> print "<center>Hello, Linux.com!</center>" >> print "</html>" >> >> One file (test.py) works; you call it up and it shows a web page with >> >> Hello, Linux.com >> >> The other fails with a server configuration error. Both are running >> under Linux, same server, same permissions. Running a character scan >> shows that both files contain the same printable characters and are >> therefore typographically identical. They are absolutely the same. >> >> The only hint at a difference I can see is that my ftp program says >> the files are of unequal lengths. test.py is 129 bytes long. >> python.py 134 bytes long. >> >> A zipped folder containing both files is at >> >> www.lambdassociates.org/weird.zip >> >> Any ideas welcome. > > They have different line-ending-conventions. Not sure if and why that > makes a difference.
Looks like the shell treats the CR as part of the interpreter name: $ cat python.py #!/usr/bin/python print "Content-type: text/html" print print "<html>" print "<center>Hello, Linux.com!</center>" print "</html>"$ $ python python.py Content-type: text/html <html> <center>Hello, Linux.com!</center> </html> $ chmod u+x python.py $ ./python.py bash: ./python.py: /usr/bin/python^M: bad interpreter: No such file or directory Peter -- http://mail.python.org/mailman/listinfo/python-list