It seems extremely unlikely that Python would not like \r\n in source code. Have you tried reducing the problem to a simple case? The Python Language Reference says that any of the platform line separators can be used for newlines.<div>

<br></div><div>-fawad<br><br><div class="gmail_quote">On Sat, Feb 19, 2011 at 6:22 PM, Jonathan Hayward <span dir="ltr">&lt;<a href="mailto:jonathan.hayward@pobox.com">jonathan.hayward@pobox.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
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 <a href="http://python.org" target="_blank">python.org</a> installer. I opened up Notepad and created a &quot;Hello world&quot; Python CGI script, put it in the cgi-bin directory, saw it crash, and looked in the logs.<div>


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


<br></div><div>Isn&#39;t it a defect/design flaw for Python on Windows to choke on &quot;\r\n&quot;-separated files? Should I file a bug, or is this a side effect of decisions that are now non-negotiable? (I wasn&#39;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 &quot;Hello world!&quot; CGI script.)</div>


<div><br>-- <br><font face="Verdana, Arial, sans"><span style="font-size:medium"><span style="border-collapse:collapse;font-family:arial, sans-serif;color:rgb(136,136,136);font-size:13px">→ Jonathan Hayward, </span></span></font><span style="border-collapse:collapse;font-family:arial, sans-serif;color:rgb(136,136,136);font-size:13px">Author, <a href="https://www.packtpub.com/django-javascript-integration-ajax-and-jquery/book" target="_blank">Django JavaScript Integration: AJAX and jQuery<br>


</a></span>
<div><font face="Verdana, Arial, sans"><span style="font-size:medium"><span style="border-collapse:collapse;font-family:arial, sans-serif;color:rgb(136,136,136);font-size:13px">→ <a href="https://www.packtpub.com/authors/profiles/jonathan-hayward" target="_blank">Author Bio</a> • <a style="color:rgb(51,70,76)" href="http://www.linkedin.com/in/jonathanhayward" target="_blank">LinkedIn Profile</a> • <a style="color:rgb(51,70,76)" href="mailto:jonathan.hayward@pobox.com" target="_blank">jonathan.hayward@pobox.com</a><br>


→ Ajax, CGI, CMS, CSS, Django, HTML, IA, JSON, JavaScript, LAMP, Linux, MVC, Perl, PHP, Python, SQL, UI, Unix, <span>Usability</span>, UX, XHTML, XML</span></span></font></div>
<div><font face="Verdana, Arial, sans"><span style="font-size:medium"><span style="border-collapse:collapse;font-family:arial, sans-serif;color:rgb(136,136,136);font-size:13px">→ With a good interest in the human side of computing and making websites a joy to use</span></span></font></div>


<br>
</div>
<br>_______________________________________________<br>
Chicago mailing list<br>
<a href="mailto:Chicago@python.org">Chicago@python.org</a><br>
<a href="http://mail.python.org/mailman/listinfo/chicago" target="_blank">http://mail.python.org/mailman/listinfo/chicago</a><br>
<br></blockquote></div><br></div>