Commits

Victor Stinner committed 33b7428

Issue #10801: Fix test_unicode_filenames() of test_zipfile

Just try to open files from the ZIP for reading, don't extract them to avoid
UnicodeEncodeError if the filename is not encodable to the filesystem encoding
(e.g. ASCII locale encoding).

Comments (0)

Files changed (1)

Lib/test/test_zipfile.py

 
         zipfp = zipfile.ZipFile(fname)
         try:
-            zipfp.extractall()
+            for name in zipfp.namelist():
+                zipfp.open(name).close()
         finally:
             zipfp.close()