]> granicus.if.org Git - python/commitdiff
#10801: do not actually extract, just open() the files in the test zipfile.
authorGeorg Brandl <georg@python.org>
Sat, 1 Jan 2011 10:42:31 +0000 (10:42 +0000)
committerGeorg Brandl <georg@python.org>
Sat, 1 Jan 2011 10:42:31 +0000 (10:42 +0000)
Lib/test/test_zipfile.py

index e8aec4fdf9ebeef5baadedb94ac09ed2a0b9d6cb..8d51528ecc7ceaaa5762b9a23864235a71b4c89f 100644 (file)
@@ -490,16 +490,11 @@ class TestsWithSourceFile(unittest.TestCase):
             self.assertTrue(zipfp2.fp is None, 'zipfp is not closed')
 
     def test_unicode_filenames(self):
-        if __name__ == '__main__':
-            myfile = sys.argv[0]
-        else:
-            myfile = __file__
-
-        mydir = os.path.dirname(myfile) or os.curdir
-        fname = os.path.join(mydir, 'zip_cp437_header.zip')
-
+        # bug #10801
+        fname = findfile('zip_cp437_header.zip')
         with zipfile.ZipFile(fname) as zipfp:
-            zipfp.extractall()
+            for name in zipfp.namelist():
+                zipfp.open(name).close()
 
     def tearDown(self):
         unlink(TESTFN)