This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author JonathanHayward
Recipients JonathanHayward
Date 2011-02-23.00:22:25
SpamBayes Score 4.1160544e-07
Marked as misclassified No
Message-id <1298420546.44.0.149906656845.issue11295@psf.upfronthosting.co.za>
In-reply-to
Content
So far as I can tell, Python 2.7 crashes on at least some ANSI / Windows \r\n-delimited source files. More specifically, as invoked by Apache as a CGI script, the source file line:

import cgi

generated an error logged by Apache, complaining that the module "cgi\r" couldn't be imported.

Email sent as follows:

--

Today I was visiting with a friend and installing OSS on his computer. On an x86_64 Windows 7 box, he had already installed Apache, and I installed Python with a python.org installer. I opened up Notepad and created a "Hello world" Python CGI script, put it in the cgi-bin directory, saw it crash, and looked in the logs.

The log message complained that I had tried to "import cgi\r": in other words, Python on Windows was choking because the file I made in Notepad used "\r\n" for line breaks. (The equivalent script made with vim, and presumably "\n" for line breaks worked predictably.)

Isn't it a defect/design flaw for Python on Windows to choke on "\r\n"-separated files? Should I file a bug, or is this a side effect of decisions that are now non-negotiable? (I wasn't thrilled, after trying to sell my friend on the idea that Python is a good language with a low barrier to entry, to find that it choked on a Notepad-edited "Hello world!" CGI script.)
History
Date User Action Args
2011-02-23 00:22:26JonathanHaywardsetrecipients: + JonathanHayward
2011-02-23 00:22:26JonathanHaywardsetmessageid: <1298420546.44.0.149906656845.issue11295@psf.upfronthosting.co.za>
2011-02-23 00:22:25JonathanHaywardlinkissue11295 messages
2011-02-23 00:22:25JonathanHaywardcreate