summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>2002-04-14 20:12:41 (GMT)
committerJack Jansen <jack.jansen@cwi.nl>2002-04-14 20:12:41 (GMT)
commit7b8c7546ebc1fc3688ef95768fa8b82f0f205490 (patch)
tree2e14b243347a9c38c82e2e774d4b201f23149916 /Lib
parentdcd2dc2fffce8614c5d2b8d303a303a599b88a23 (diff)
downloadcpython-7b8c7546ebc1fc3688ef95768fa8b82f0f205490.zip
cpython-7b8c7546ebc1fc3688ef95768fa8b82f0f205490.tar.gz
cpython-7b8c7546ebc1fc3688ef95768fa8b82f0f205490.tar.bz2
Mass checkin of universal newline support.
Highlights: import and friends will understand any of \r, \n and \r\n as end of line. Python file input will do the same if you use mode 'U'. Everything can be disabled by configuring with --without-universal-newlines. See PEP278 for details.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/linecache.py2
-rw-r--r--Lib/py_compile.py2
2 files changed, 2 insertions, 2 deletions
diff --git a/Lib/linecache.py b/Lib/linecache.py
index cd3e50d..9953034 100644
--- a/Lib/linecache.py
+++ b/Lib/linecache.py
@@ -90,7 +90,7 @@ def updatecache(filename):
## print '*** Cannot stat', filename, ':', msg
return []
try:
- fp = open(fullname, 'r')
+ fp = open(fullname, 'rU')
lines = fp.readlines()
fp.close()
except IOError, msg:
diff --git a/Lib/py_compile.py b/Lib/py_compile.py
index 48c4afc..afeaae1 100644
--- a/Lib/py_compile.py
+++ b/Lib/py_compile.py
@@ -44,7 +44,7 @@ def compile(file, cfile=None, dfile=None):
"""
import os, marshal, __builtin__
- f = open(file)
+ f = open(file, 'U')
try:
timestamp = long(os.fstat(f.fileno())[8])
except AttributeError: