This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author alter-bug-tracer
Recipients alter-bug-tracer
Date 2019-05-21.12:32:49
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1558441969.28.0.928640082083.issue36993@roundup.psfhosted.org>
In-reply-to
Content
The following code throws an IndexError when attempting to extract a malformed archive (attached):

import zipfile
import sys

zf = zipfile.ZipFile(sys.argv[1])
for info in zf.infolist():
  zf.extract(info.filename)

Result:
Traceback (most recent call last):
  File "code.py", line 4, in <module>
    zf = zipfile.ZipFile(sys.argv[1])
  File "/usr/local/lib/python3.8/zipfile.py", line 1230, in __init__
    self._RealGetContents()
  File "/usr/local/lib/python3.8/zipfile.py", line 1353, in _RealGetContents
    x._decodeExtra()
  File "/usr/local/lib/python3.8/zipfile.py", line 480, in _decodeExtra
    self.file_size = counts[idx]
IndexError: tuple index out of range
History
Date User Action Args
2019-05-21 12:32:49alter-bug-tracersetrecipients: + alter-bug-tracer
2019-05-21 12:32:49alter-bug-tracersetmessageid: <1558441969.28.0.928640082083.issue36993@roundup.psfhosted.org>
2019-05-21 12:32:49alter-bug-tracerlinkissue36993 messages
2019-05-21 12:32:49alter-bug-tracercreate