diff options
Diffstat (limited to 'Lib/test/test_zipimport.py')
| -rw-r--r-- | Lib/test/test_zipimport.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/Lib/test/test_zipimport.py b/Lib/test/test_zipimport.py index ba4e34a..61a6c0a 100644 --- a/Lib/test/test_zipimport.py +++ b/Lib/test/test_zipimport.py @@ -382,6 +382,20 @@ class UncompressedZipImportTestCase(ImportHooksBaseTestCase): files = {TESTMOD + ".py": (NOW, raise_src)} self.doTest(None, files, TESTMOD, call=self.doTraceback) + @unittest.skipIf(support.TESTFN_UNENCODABLE is None, + "need an unencodable filename") + def testUndecodable(self): + filename = support.TESTFN_UNENCODABLE + ".zip" + z = ZipFile(filename, "w") + zinfo = ZipInfo(TESTMOD + ".py", time.localtime(NOW)) + zinfo.compress_type = self.compression + z.writestr(zinfo, test_src) + z.close() + try: + zipimport.zipimporter(filename) + finally: + os.remove(filename) + @unittest.skipUnless(zlib, "requires zlib") class CompressedZipImportTestCase(UncompressedZipImportTestCase): |
