]> granicus.if.org Git - python/commitdiff
Fix list_test.py::test_print(): Read and write the
authorWalter Dörwald <walter@livinglogic.de>
Thu, 24 May 2007 17:44:33 +0000 (17:44 +0000)
committerWalter Dörwald <walter@livinglogic.de>
Thu, 24 May 2007 17:44:33 +0000 (17:44 +0000)
file in text mode, so the file content comes back
as str not bytes.

Lib/test/list_tests.py

index a5790c3c9f7a35594a889787b868a24641d1f7d6..5162f2ebaf8f73054f388018ab908dd8f9616963 100644 (file)
@@ -53,10 +53,10 @@ class CommonTest(seq_tests.CommonTest):
         d.append(d)
         d.append(400)
         try:
-            fo = open(test_support.TESTFN, "wb")
+            fo = open(test_support.TESTFN, "w", encoding="ascii")
             fo.write(str(d))
             fo.close()
-            fo = open(test_support.TESTFN, "rb")
+            fo = open(test_support.TESTFN, "r", encoding="ascii")
             self.assertEqual(fo.read(), repr(d))
         finally:
             fo.close()