[New-bugs-announce] [issue39294] zipfile.ZipInfo objects contain invalid 'extra' fields.

Bram Stolk report at bugs.python.org
Fri Jan 10 16:57:59 EST 2020


New submission from Bram Stolk <b.stolk at gmail.com>:

This has been tested with Windows Python 2.7 and Python 3.8

If you get the ZipInfo objects of a ZIP file that is larger than 2GiB, then all the ZipInfo entries with a header offset > 2G will report phantom 'extra' data.

import zipfile
zipname = "reallybig.zip"
z = zipfile.ZipFile( zipname )
zi = z.infolist()
for inf in zi:
      print( inf.filename, inf.header_offset, inf.extra )  

And observe that:
* All entries with offset < 2G will report no extra field.
* All entries with offset > 2G will report extra field.

It's hard to package this up as a self-contained test, because it requires a very large zip to test.

----------
components: IO
messages: 359762
nosy: Bram Stolk
priority: normal
severity: normal
status: open
title: zipfile.ZipInfo objects contain invalid 'extra' fields.
type: behavior
versions: Python 3.8

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue39294>
_______________________________________


More information about the New-bugs-announce mailing list