Commit f1b6924d authored by Chris Lamb's avatar Chris Lamb 💬

Only override the exit code from our special-cased calls to zipinfo(1) if they...

Only override the exit code from our special-cased calls to zipinfo(1) if they are 1 or 2 to avoid potentially masking real errors. (re. #60)
parent a98f743a
......@@ -193,10 +193,15 @@ class ZipFile(File):
class IgnoreReturncodeMixin(object):
@property
def returncode(self):
# zipinfo returns with an exit code of 1 when reading Mozilla-optimized
# or Java "jmod" ZIPs as they have non-standard headers which are fine
# to ignore.
return 0
returncode = super().returncode
# zipinfo returns with an exit code of 1 or 2 when reading
# Mozilla-optimized or Java "jmod" ZIPs as they have non-standard
# headers which are safe to ignore.
if returncode in (1, 2):
returncode = 0
return returncode
class IgnoreReturncodeZipinfo(IgnoreReturncodeMixin, Zipinfo):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment