From bb580d3eda350e25f27237e22e28d208d44f213a Mon Sep 17 00:00:00 2001 From: "Michael W. Hudson" Date: Fri, 23 Aug 2002 16:10:13 +0000 Subject: [PATCH] backport montanaro's checkin of revision 1.9 of test_gzip.py force gzip module to open files using 'b'inary mode. closes patch #536278. --- Lib/test/test_gzip.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Lib/test/test_gzip.py b/Lib/test/test_gzip.py index a5660a9ec26b..d42dee666789 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) -- 2.47.3