[issue14315] zipfile.ZipFile() unable to open zip File

Martin v. Löwis report at bugs.python.org
Sun May 13 21:03:38 CEST 2012


Martin v. Löwis <martin at v.loewis.de> added the comment:

>> So as a way out, I propose that the ZipFile class gains a "strict"
>> attribute, indicating whether "acceptable" violations of the spec
>> are ignored or reported as exceptions.
>
> It is a not easy task (and unnecessary, I suppose). Now zipfile
> ignores many errors (for example, it completely ignores local file
> headers).

Why do you consider this difficult? Just add a "strict" flag, make
it false by default, and raise an error if there is any unparsable
extra data.

I'm not asking that you implement a complete validity check for all
aspects of the zip spec - just that there is a mode where it continues
to raise an exception as it currently does (but with a better
exception).

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue14315>
_______________________________________


More information about the Python-bugs-list mailing list