bpo-34341: Fix appending to ZIP archives with the ZIP64 extension. (G… · python/cpython@efdf316 (original) (raw)
`@@ -750,6 +750,20 @@ def test_absolute_arcnames(self):
`
750
750
`with zipfile.ZipFile(TESTFN2, "r", zipfile.ZIP_STORED) as zipfp:
`
751
751
`self.assertEqual(zipfp.namelist(), ["absolute"])
`
752
752
``
``
753
`+
def test_append(self):
`
``
754
`+
Test that appending to the Zip64 archive doesn't change
`
``
755
`+
extra fields of existing entries.
`
``
756
`+
with zipfile.ZipFile(TESTFN2, "w", allowZip64=True) as zipfp:
`
``
757
`+
zipfp.writestr("strfile", self.data)
`
``
758
`+
with zipfile.ZipFile(TESTFN2, "r", allowZip64=True) as zipfp:
`
``
759
`+
zinfo = zipfp.getinfo("strfile")
`
``
760
`+
extra = zinfo.extra
`
``
761
`+
with zipfile.ZipFile(TESTFN2, "a", allowZip64=True) as zipfp:
`
``
762
`+
zipfp.writestr("strfile2", self.data)
`
``
763
`+
with zipfile.ZipFile(TESTFN2, "r", allowZip64=True) as zipfp:
`
``
764
`+
zinfo = zipfp.getinfo("strfile")
`
``
765
`+
self.assertEqual(zinfo.extra, extra)
`
``
766
+
753
767
`@requires_zlib
`
754
768
`class DeflateTestZip64InSmallFiles(AbstractTestZip64InSmallFiles,
`
755
769
`unittest.TestCase):
`