Python and Apache

David Fuess fuess1 at home.com
Wed Apr 18 09:43:45 EDT 2001


On Tue, 17 Apr 2001 23:21:48 -0700, Tim Roberts <timr at probo.com>
wrote:

>David Fuess <fuess1 at home.com> wrote:
>>
>>The problem was located in the line endings in the script files. I had
>>prepared the scripts on my PC and transfered them via FTP. They went
>>as binary because the extensions were not recognized as ASCII. It is
>>interesting to note, however, that python correctly interpreted the
>>files anyway, but neither Linux nor Apache did.
>
>You must have been running this using "python hello".  This would have
>failed for you if you had typed at the command line:
>
>   ./hello

You are exactly right. I wondered about the difference between "python
hello" and "./hello" and knew it was a clue.
>
>In case you're curious, the line-ending problem affects exactly one line:
>the first one.  It's not a Python failure nor an Apache failure, but rather
>a failure in the Linux loader in processing #! lines.  The system tries to
>find /usr/local/bin/python\r, with a carriage return at the end.
>Naturally, it failed to find that file.

Ahhhh, I love it when we get to the root cause. I'll pack this one
away in my little toolkit of gotchas that return to bite again. Thanks
for the explanation.

Dave



More information about the Python-list mailing list