summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorSkip Montanaro <skip@pobox.com>2002-05-23 01:43:05 (GMT)
committerSkip Montanaro <skip@pobox.com>2002-05-23 01:43:05 (GMT)
commit12424bc0eff82e0ebf5134cca1139b7d4b6faed0 (patch)
tree1cf01b717feae2a55e97d5ff8a8dc6fc119f53ff /Lib/test
parentd4e5be53409699d89c358bd16784bad59c37dfa7 (diff)
downloadcpython-12424bc0eff82e0ebf5134cca1139b7d4b6faed0.zip
cpython-12424bc0eff82e0ebf5134cca1139b7d4b6faed0.tar.gz
cpython-12424bc0eff82e0ebf5134cca1139b7d4b6faed0.tar.bz2
force gzip module to open files using 'b'inary mode.
closes patch #536278.
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_gzip.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/Lib/test/test_gzip.py b/Lib/test/test_gzip.py
index a5660a9..d42dee6 100644
--- a/Lib/test/test_gzip.py
+++ b/Lib/test/test_gzip.py
@@ -18,7 +18,7 @@ data2 = """/* zlibmodule.c -- gzip-compatible data compression */
f = gzip.GzipFile(filename, 'wb') ; f.write(data1 * 50) ; f.close()
-f = gzip.GzipFile(filename, 'rb') ; d = f.read() ; f.close()
+f = gzip.GzipFile(filename, 'r') ; d = f.read() ; f.close()
verify(d == data1*50)
# Append to the previous file
@@ -75,4 +75,8 @@ for pos in range(0, 256, 16):
f.write('GZ\n')
f.close()
+f = gzip.GzipFile(filename, 'r')
+verify(f.myfileobj.mode == 'rb')
+f.close()
+
os.unlink(filename)