From: Michael W. Hudson Date: Fri, 23 Aug 2002 16:10:13 +0000 (+0000) Subject: backport montanaro's checkin of X-Git-Tag: v2.2.2b1~199 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=bb580d3eda350e25f27237e22e28d208d44f213a;p=thirdparty%2FPython%2Fcpython.git 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. --- 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)