]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Issue #12451: Open the test file in binary mode in test_bz2, the text file is
authorVictor Stinner <victor.stinner@haypocalc.com>
Thu, 30 Jun 2011 16:25:07 +0000 (18:25 +0200)
committerVictor Stinner <victor.stinner@haypocalc.com>
Thu, 30 Jun 2011 16:25:07 +0000 (18:25 +0200)
not needed.

Lib/test/test_bz2.py

index 75078be80f937ef4ef2cbaa251d7643591899fd5..5a7d342afde77bfba3fa2d88d92010ec80508d8e 100644 (file)
@@ -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())