Commit e6eafa2a authored by Victor Stinner's avatar Victor Stinner

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).
parent 721bb33e
......@@ -405,7 +405,8 @@ class TestsWithSourceFile(unittest.TestCase):
zipfp = zipfile.ZipFile(fname)
try:
zipfp.extractall()
for name in zipfp.namelist():
zipfp.open(name).close()
finally:
zipfp.close()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment