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:
parent
721bb33e3b
commit
e6eafa2ade
|
@ -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()
|
||||
|
||||
|
|
Loading…
Reference in New Issue