]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Close SF patch 523944: importing modules with foreign newlines.
authorJeremy Hylton <jeremy@alum.mit.edu>
Fri, 28 Jun 2002 23:32:51 +0000 (23:32 +0000)
committerJeremy Hylton <jeremy@alum.mit.edu>
Fri, 28 Jun 2002 23:32:51 +0000 (23:32 +0000)
Didn't use the patch, because universal newlines support made it easy.
It might be worth fixing the actual problem in the 2.2 maintenance
branch, in which case the patch is still needed.

Lib/imputil.py

index 5d462f16928a199bd6cb1890ccacc65d8367c37a..04111dcaa612cbc53c4dcfca5e4260edd1e49179 100644 (file)
@@ -410,7 +410,7 @@ def _compile(pathname, timestamp):
     saved back to the filesystem for future imports. The source file's
     modification timestamp must be provided as a Long value.
     """
-    codestring = open(pathname, 'r').read()
+    codestring = open(pathname, 'rU').read()
     if codestring and codestring[-1] != '\n':
         codestring = codestring + '\n'
     code = __builtin__.compile(codestring, pathname, 'exec')