diff --git a/Lib/test/test_zipfile/test_core.py b/Lib/test/test_zipfile/test_core.py index 4f20209927e7b3d..441508518d01d6c 100644 --- a/Lib/test/test_zipfile/test_core.py +++ b/Lib/test/test_zipfile/test_core.py @@ -1189,6 +1189,55 @@ def test_generated_valid_zip64_extra(self): self.assertEqual(zinfo.header_offset, expected_header_offset) self.assertEqual(zf.read(zinfo), expected_content) + def test_generated_extra_in_local_entry(self): + """Should not write duplicated or improper fields to local file entry.""" + comment = '\u4e00'.encode('utf-8') + + # zip64 + fh = io.BytesIO() + with zipfile.ZipFile(fh, 'w') as zh: + zinfo = zipfile.ZipInfo('strfile') + zinfo.extra = ( + # zip64 + struct.pack(' ZIP64_LIMIT or compress_size > ZIP64_LIMIT if zip64: fmt = '` +had them.