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 G.Rakosy
Recipients G.Rakosy
Date 2021-08-05.13:59:44
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1628171985.04.0.233917766436.issue44841@roundup.psfhosted.org>
In-reply-to
Content
"""
ZipInfo crashes on filemode

In file /usr/lib/python3.7/zipfile.py | class ZipInfo.__slots__
Does not contain keyword 'filemode'.
"""

import zipfile

file_zip = zipfile.ZipFile("test-one-dir.zip", mode='r')

res = []

info = file_zip.infolist()
print("info[0]", type(info[0]), info[0])

print("\n# ## Good")
for inf in info:
    print("\ninf", type(inf), inf)
    res.append((
        inf.filename,
##        inf.filemode,
        inf.compress_type,
        inf.compress_size,
        inf.file_size))

for fileinfo in res:
    print("\n", fileinfo)

print("\n# ## Bad")
for inf in info:
    print("\ninf", type(inf), inf)
    res.append((
        inf.filename,
        inf.filemode,
        inf.compress_type,
        inf.compress_size,
        inf.file_size))

for fileinfo in res:
    print("\n", fileinfo)
History
Date User Action Args
2021-08-05 13:59:45G.Rakosysetrecipients: + G.Rakosy
2021-08-05 13:59:45G.Rakosysetmessageid: <1628171985.04.0.233917766436.issue44841@roundup.psfhosted.org>
2021-08-05 13:59:45G.Rakosylinkissue44841 messages
2021-08-05 13:59:44G.Rakosycreate