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:29:31
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1558441771.7.0.234228276725.issue36992@roundup.psfhosted.org>
In-reply-to
Content
The following code throws an AttributeError 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 6, in <module>
    zf.extract(info.filename)
  File "/usr/local/lib/python3.8/zipfile.py", line 1607, in extract
    return self._extract_member(member, path, pwd)
  File "/usr/local/lib/python3.8/zipfile.py", line 1679, in _extract_member
    shutil.copyfileobj(source, target)
  File "/usr/local/lib/python3.8/shutil.py", line 198, in copyfileobj
    buf = fsrc_read(length)
  File "/usr/local/lib/python3.8/zipfile.py", line 903, in read
    data = self._read1(n)
  File "/usr/local/lib/python3.8/zipfile.py", line 986, in _read1
    data = self._decompressor.decompress(data)
  File "/usr/local/lib/python3.8/zipfile.py", line 635, in decompress
    self._decomp = lzma.LZMADecompressor(lzma.FORMAT_RAW, filters=[
AttributeError: 'NoneType' object has no attribute 'LZMADecompressor'
History
Date User Action Args
2019-05-21 12:29:31alter-bug-tracersetrecipients: + alter-bug-tracer
2019-05-21 12:29:31alter-bug-tracersetmessageid: <1558441771.7.0.234228276725.issue36992@roundup.psfhosted.org>
2019-05-21 12:29:31alter-bug-tracerlinkissue36992 messages
2019-05-21 12:29:31alter-bug-tracercreate