mirror of
https://github.com/python/cpython
synced 2026-09-29 12:10:30 +03:00
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
1 changed files with 2 additions and 1 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue