Under what circumstances do zip files have garbage appended to them? Are there buggy zipfile-generating programs out there, or does the garbage come from, say, an extra newline added when a zipfile is attached to an e-mail? The patch looks OK, but I'm nervous about adding code to silently ignore an incorrect zipfile.
Since there's no reply about where ZIP files with appended 'garbage' might come from, should this be closed? I agree with amk; it doesn't seem wise to ignore incorrectly formatted files without a good reason. On a related note, it seems that correctly formatted ZIP files with comments longer than 4k will not be recognized as a ZIP file by the zipfile module. There's some comment about not looking at more than the last 4k of the file for "efficiency" reasons, but failing to interpret a correct file seems to override the efficiency concern of reading/searching another 60k of data. I'll open a separate tracker item for this, since it's not strictly related to the original issue.
I searched for references to 'zip file concatenate|append' and found no reference to extra data being ignored, so I'll agree with Alan and close this patch. Thanks for your contribution, anyway!
History
Date
User
Action
Args
2022-04-10 16:10:02
admin
set
github: 38877
2008-01-19 14:00:04
akuchling
set
status: open -> closedresolution: rejectedmessages: +