[issue39294] zipfile.ZipInfo objects contain invalid 'extra' fields.

2020-02-01 Thread Daniel Hillier


Daniel Hillier  added the comment:

This looks to be expected behaviour for the zip64 extension in the zip spec 
(for handling large files or large archives).

Section 4.4.1.4 of the zip spec outlines when the zip64 extra fields are used 
(https://pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXT). In short, when 
the file offset header (number of bytes to the start of the file in the 
archive) exceeds the size allotted in the header in the original spec 
(0x or just under 2Gb).

Let me know if what you're observing is unrelated to this.

--
nosy: +dhillier

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39294] zipfile.ZipInfo objects contain invalid 'extra' fields.

2020-01-10 Thread Bram Stolk


New submission from Bram Stolk :

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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com