diff options
author | Guido van Rossum <guido@python.org> | 1999-04-07 19:00:58 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1999-04-07 19:00:58 (GMT) |
commit | 052364b20b78800a1edec0b61392934abfc4176f (patch) | |
tree | 5b51f9284c257eb36fcc825512b30ad2db2ff7a5 /Lib/test/test_gzip.py | |
parent | 00b6d0f2248960c2a08aaffd44a68f0bb4ba3cf3 (diff) | |
download | cpython-052364b20b78800a1edec0b61392934abfc4176f.zip cpython-052364b20b78800a1edec0b61392934abfc4176f.tar.gz cpython-052364b20b78800a1edec0b61392934abfc4176f.tar.bz2 |
Use binary mode for all gzip files we open.
Diffstat (limited to 'Lib/test/test_gzip.py')
-rw-r--r-- | Lib/test/test_gzip.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Lib/test/test_gzip.py b/Lib/test/test_gzip.py index ae7ec17..3ea2ba9 100644 --- a/Lib/test/test_gzip.py +++ b/Lib/test/test_gzip.py @@ -16,15 +16,15 @@ data2 = """/* zlibmodule.c -- gzip-compatible data compression */ /* See http://www.winimage.com/zLibDll for Windows */ """ -f = gzip.GzipFile(filename, 'w') ; f.write(data1) ; f.close() +f = gzip.GzipFile(filename, 'wb') ; f.write(data1) ; f.close() -f = gzip.GzipFile(filename, 'r') ; d = f.read() ; f.close() +f = gzip.GzipFile(filename, 'rb') ; d = f.read() ; f.close() assert d == data1 # Append to the previous file -f = gzip.GzipFile(filename, 'a') ; f.write(data2) ; f.close() +f = gzip.GzipFile(filename, 'ab') ; f.write(data2) ; f.close() -f = gzip.GzipFile(filename, 'r') ; d = f.read() ; f.close() +f = gzip.GzipFile(filename, 'rb') ; d = f.read() ; f.close() assert d == data1+data2 os.unlink( filename ) |