]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Add a unittest for r73566.
authorGregory P. Smith <greg@mad-scientist.com>
Tue, 7 Jul 2009 05:06:04 +0000 (05:06 +0000)
committerGregory P. Smith <greg@mad-scientist.com>
Tue, 7 Jul 2009 05:06:04 +0000 (05:06 +0000)
Lib/test/test_zipfile.py

index 82602c1bbbf22b0b541c42a1ec658987478b28cf..ed800c577dd12b110d651426568e564df6fba077 100644 (file)
@@ -379,6 +379,14 @@ class TestsWithSourceFile(unittest.TestCase):
         for f in (TESTFN2, TemporaryFile(), io.BytesIO()):
             self.zip_test_writestr_permissions(f, zipfile.ZIP_STORED)
 
+    def test_writestr_extended_local_header_issue1202(self):
+        orig_zip = zipfile.ZipFile(TESTFN2, 'w')
+        for data in 'abcdefghijklmnop':
+            zinfo = zipfile.ZipInfo(data)
+            zinfo.flag_bits |= 0x08  # Include an extended local header.
+            orig_zip.writestr(zinfo, data)
+        orig_zip.close()
+
     def tearDown(self):
         os.remove(TESTFN)
         os.remove(TESTFN2)