[issue44841] ZipInfo crashes on filemode

2021-09-28 Thread Gabor Rakosy


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)
---

In the print, it shows the option 'filemode'. And that option is not 
accessible. That's the reason why i made this issue.

--
Added file: https://bugs.python.org/file50309/test-zip.zip

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44841] ZipInfo crashes on filemode

2021-09-19 Thread Ronald Oussoren


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.

--
nosy: +ronaldoussoren

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44841] ZipInfo crashes on filemode

2021-09-09 Thread Irit Katriel


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 tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44841] ZipInfo crashes on filemode

2021-08-05 Thread Gabor Rakosy


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[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)

--
components: Library (Lib)
messages: 399006
nosy: G.Rakosy
priority: normal
severity: normal
status: open
title: ZipInfo crashes on filemode
type: crash
versions: Python 3.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com