]> granicus.if.org Git - python/commitdiff
Merged revisions 62726 via svnmerge from
authorMartin v. Löwis <martin@v.loewis.de>
Mon, 5 May 2008 17:50:05 +0000 (17:50 +0000)
committerMartin v. Löwis <martin@v.loewis.de>
Mon, 5 May 2008 17:50:05 +0000 (17:50 +0000)
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r62726 | martin.v.loewis | 2008-05-05 19:47:06 +0200 (Mo, 05 Mai 2008) | 2 lines

  Fix Unicode filename test.
........

Lib/test/test_zipfile.py

index c69892b2bd2f0d935cad302dd53d65be877a5135..6878262556de29f7e5ac302d2f4ed3189d9dd437 100644 (file)
@@ -544,10 +544,12 @@ class OtherTests(unittest.TestCase):
     def testUnicodeFilenames(self):
         zf = zipfile.ZipFile(TESTFN, "w")
         zf.writestr("foo.txt", "Test for unicode filename")
-        zf.writestr("fo\xf6.txt", "Test for unicode filename")
+        zf.writestr("\xf6.txt", "Test for unicode filename")
+        zf.close()
+        zf = zipfile.ZipFile(TESTFN, "r")
+        self.assertEqual(zf.filelist[0].filename, "foo.txt")
+        self.assertEqual(zf.filelist[1].filename, "\xf6.txt")
         zf.close()
-        zf = zipfile.ZipFile(TESTFN, "w")
-
 
     def testCreateNonExistentFileForAppend(self):
         if os.path.exists(TESTFN):