pR0Ps/zipstream-ng

7zip 'Warnings: Headers Error'

Closed this issue · 4 comments

Hi,
I am using zipstream-ng to stream data from several URL-endpoints into one zip stream. For that I adapted your code posted in #11 (comment)

The zip file is created fine. However, on extraction with 7zip on a Windows PC it shows 'Warnings: Headers Error' even though it extracts the files OK. This happens both when writing the zipstream to disk or sending it as Flask Response object.

Have you encountered this before and do you have any ideas on how to get rid of that warning?

Best, Sebastian

pR0Ps commented

No, I haven't seen that happen. From some searching around, it looks like a somewhat-generic message that 7zip emits when some metadata (CRC, zip64, file sizes, etc.) doesn't match the actual file data, but not in a way that prevents extraction.

I'd like to attempt to fix the issue though. If you have a zip file that exhibits the issue (that doesn't have anything sensitive in it) could you upload it here (or externally if it's too large) so I can take a look?

Thanks for looking into this. Find a generated zip-archive attached along with my little Flask app that generated it.

requirements.txt
download_app.py.txt
HH_WFS_abfall_recycling.zip

pR0Ps commented

Fixed as of 6eef3b3 (released in v1.3.5). The issue was that the data sizes in the file headers weren't properly being set to 0xFFFFFFFF when a Zip64 extra field was added. Not something that most (all?) unzipping programs would have an issue with since the size was still where it should've been, but still something that doesn't conform to spec.

Awesome, thanks for the quick fix! Unzipping now works without warning in 7Zip.