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).
This commit is contained in:
Victor Stinner 2011-06-10 16:32:54 +02:00
parent 721bb33e3b
commit e6eafa2ade
1 changed files with 2 additions and 1 deletions

View File

@ -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()