[issue28494] is_zipfile false positives
John Jolly
report at bugs.python.org
Sat Dec 30 14:28:09 EST 2017
John Jolly <jjolly at suse.com> added the comment:
Fix submitted that evaluates the ECD structure and validates the first CD entry. The fix also handles empty zipfiles.
IMO the purpose of this API is to *quickly* verify that the file is a valid zipfile. With this fix, the API only reads another 46 bytes of data (after a seek, of course). This should still qualify as "quick", especially after having potentially read 64k of data.
Perhaps a full zip validator would be appropriate in addition to is_zipfile. That would be more appropriate as a full feature rather than in this bugfix.
----------
nosy: +jjolly
_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue28494>
_______________________________________
More information about the Python-bugs-list
mailing list