(original) (raw)
changeset: 70757:33b7428e65b4 branch: 3.1 parent: 70644:d4a99fb5c2c5 user: Victor Stinner victor.stinner@haypocalc.com date: Fri Jun 10 16:32:54 2011 +0200 files: Lib/test/test_zipfile.py description: 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). diff -r d4a99fb5c2c5 -r 33b7428e65b4 Lib/test/test_zipfile.py --- a/Lib/test/test_zipfile.py Sun Jun 05 10:56:44 2011 +0200 +++ b/Lib/test/test_zipfile.py Fri Jun 10 16:32:54 2011 +0200 @@ -405,7 +405,8 @@ zipfp = zipfile.ZipFile(fname) try: - zipfp.extractall() + for name in zipfp.namelist(): + zipfp.open(name).close() finally: zipfp.close() /victor.stinner@haypocalc.com