Gabor Rakosy added the comment:
Like Ronald Oussoren wrote "ZipInfo does not have a filemode attribute, that's
why it is not in ZipInfo.__slots__."
import zipfile
file_zip = zipfile.ZipFile("test-one-dir.zip", mode='r')
for info in file_zip.infolist():
print(info)
--
Ronald Oussoren added the comment:
I'm not sure what the issue is here. ZipInfo does not have a filemode
attribute, that's why it is not in ZipInfo.__slots__.
That said, it might be interesting to add a property to ZipInfo that extracts
the file mode from ZipInfo.external_attr.
--
n
Irit Katriel added the comment:
Crash typically means segfault or the like, not an exception.
Can you provide code to create the file "test-one-dir.zip" so that we can
reproduce the issue?
--
nosy: +iritkatriel
type: crash -> behavior
___
Python
New submission from Gabor Rakosy :
"""
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