summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@haypocalc.com>2011-06-10 14:32:54 (GMT)
committerVictor Stinner <victor.stinner@haypocalc.com>2011-06-10 14:32:54 (GMT)
commite6eafa2ade22dc687eee78374fa93d4b9ab7a2c1 (patch)
treeb723224da556f75fbfe3bb629d300edab605bdd6
parent721bb33e3be644eca0f99b7e11bf183ff84a88fd (diff)
downloadcpython-e6eafa2ade22dc687eee78374fa93d4b9ab7a2c1.zip
cpython-e6eafa2ade22dc687eee78374fa93d4b9ab7a2c1.tar.gz
cpython-e6eafa2ade22dc687eee78374fa93d4b9ab7a2c1.tar.bz2
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).
-rw-r--r--Lib/test/test_zipfile.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/test/test_zipfile.py b/Lib/test/test_zipfile.py
index a36b010..ee7524e 100644
--- a/Lib/test/test_zipfile.py
+++ b/Lib/test/test_zipfile.py
@@ -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()