From: Victor Stinner Date: Thu, 30 Jun 2011 16:25:07 +0000 (+0200) Subject: Issue #12451: Open the test file in binary mode in test_bz2, the text file is X-Git-Tag: v3.3.0a1~1997 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=938f635acb65873a55adeae8f1e5351b3ac5ea74;p=thirdparty%2FPython%2Fcpython.git Issue #12451: Open the test file in binary mode in test_bz2, the text file is not needed. --- diff --git a/Lib/test/test_bz2.py b/Lib/test/test_bz2.py index 75078be80f93..5a7d342afde7 100644 --- a/Lib/test/test_bz2.py +++ b/Lib/test/test_bz2.py @@ -340,7 +340,7 @@ class BZ2FileTest(BaseTest): def testFileno(self): self.createTempFile() - with open(self.filename) as rawf: + with open(self.filename, 'rb') as rawf: with BZ2File(fileobj=rawf) as bz2f: self.assertEqual(bz2f.fileno(), rawf.fileno())