Issue #15204: Deprecated the 'U' mode in file-like objects.

This commit is contained in:
Serhiy Storchaka 2013-11-23 22:12:06 +02:00
parent d41c343f28
commit 6787a3806e
13 changed files with 45 additions and 13 deletions

View file

@ -38,9 +38,9 @@ def main():
fromdate = file_mtime(fromfile)
todate = file_mtime(tofile)
with open(fromfile, 'U') as ff:
with open(fromfile) as ff:
fromlines = ff.readlines()
with open(tofile, 'U') as tf:
with open(tofile) as tf:
tolines = tf.readlines()
if options.u:

View file

@ -60,7 +60,7 @@ def fail(msg):
# couldn't be opened
def fopen(fname):
try:
return open(fname, 'U')
return open(fname)
except IOError as detail:
return fail("couldn't open " + fname + ": " + str(detail))