diff options
author | Martin v. Löwis <martin@v.loewis.de> | 2008-05-05 17:16:58 (GMT) |
---|---|---|
committer | Martin v. Löwis <martin@v.loewis.de> | 2008-05-05 17:16:58 (GMT) |
commit | 471617d6d324ca3d119ddaa7206d4b902475e4be (patch) | |
tree | 45d32f883e0dfd85abbd87da9149993ce0494116 /Lib/test | |
parent | 9c19bc62478e1cd732623abfdf701239d2f860ce (diff) | |
download | cpython-471617d6d324ca3d119ddaa7206d4b902475e4be.zip cpython-471617d6d324ca3d119ddaa7206d4b902475e4be.tar.gz cpython-471617d6d324ca3d119ddaa7206d4b902475e4be.tar.bz2 |
Issue #1734346: Support Unicode file names for zipfiles.
Diffstat (limited to 'Lib/test')
-rwxr-xr-x | Lib/test/regrtest.py | 2 | ||||
-rw-r--r-- | Lib/test/test_zipfile.py | 9 |
2 files changed, 10 insertions, 1 deletions
diff --git a/Lib/test/regrtest.py b/Lib/test/regrtest.py index b092bd9..d8d6590 100755 --- a/Lib/test/regrtest.py +++ b/Lib/test/regrtest.py @@ -1,6 +1,6 @@ #! /usr/bin/env python -"""Regression test. +"""Regression test driver. This will find all modules whose name is "test_*" in the test directory, and run them. Various command line options provide diff --git a/Lib/test/test_zipfile.py b/Lib/test/test_zipfile.py index 082b918..ace5a88 100644 --- a/Lib/test/test_zipfile.py +++ b/Lib/test/test_zipfile.py @@ -553,6 +553,15 @@ class PyZipFileTests(unittest.TestCase): class OtherTests(unittest.TestCase): + def testUnicodeFilenames(self): + zf = zipfile.ZipFile(TESTFN, "w") + zf.writestr(u"foo.txt", "Test for unicode filename") + zf.writestr(u"fo\xf6.txt", "Test for unicode filename") + assert isinstance(zf.infolist()[0].filename, unicode) + zf.close() + zf = zipfile.ZipFile(TESTFN, "w") + + def testCreateNonExistentFileForAppend(self): if os.path.exists(TESTFN): os.unlink(TESTFN) |