[issue26185] zipfile.ZipInfo slots can raise unexpected AttributeError

2020-08-02 Thread Ned Deily


Ned Deily  added the comment:

Fixed in 3.9.0

--
nosy: +ned.deily
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.9 -Python 3.5, Python 3.6

___
Python tracker 

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



[issue26185] zipfile.ZipInfo slots can raise unexpected AttributeError

2020-08-02 Thread Mickaël Schoentgen

Mickaël Schoentgen  added the comment:

The ticket could be closed, right? The fix was merged quite some time ago.

--
nosy: +Tiger-222

___
Python tracker 

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



[issue26185] zipfile.ZipInfo slots can raise unexpected AttributeError

2019-09-09 Thread Dino Viehland

Dino Viehland  added the comment:


New changeset 992347d7376765fe3f4fc958fb1be193ba21f6c3 by Dino Viehland 
(Mickaël Schoentgen) in branch 'master':
bpo-26185: Fix repr() on empty ZipInfo object (#13441)
https://github.com/python/cpython/commit/992347d7376765fe3f4fc958fb1be193ba21f6c3


--
nosy: +dino.viehland

___
Python tracker 

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



[issue26185] zipfile.ZipInfo slots can raise unexpected AttributeError

2019-05-20 Thread Mickaël Schoentgen

Change by Mickaël Schoentgen :


--
pull_requests: +13350

___
Python tracker 

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



[issue26185] zipfile.ZipInfo slots can raise unexpected AttributeError

2016-01-23 Thread SilentGhost

Changes by SilentGhost :


--
stage:  -> patch review

___
Python tracker 

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



[issue26185] zipfile.ZipInfo slots can raise unexpected AttributeError

2016-01-23 Thread SilentGhost

Changes by SilentGhost :


--
nosy: +alanmcintyre, serhiy.storchaka, twouters

___
Python tracker 

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



[issue26185] zipfile.ZipInfo slots can raise unexpected AttributeError

2016-01-23 Thread Matthew Zipay

New submission from Matthew Zipay:

The zipfile.ZipInfo.__init__ method permits several of ZipInfo's slot 
attributes to go uninitialized unless the object is obtained from 
ZipFile.getinfo() or ZipFile.infolist().

As a result, accessing those attributes (header_offset, CRC, compress_size, or 
file_size) or attempting to repr() a ZipInfo object can fail unexpectedly with 
AttributeError. (I say "unexpectedly" because ZipInfo.__init__ and its 
attributes are public/documented, so the attributes ought to be properly 
initialized regardless of how the object gets created.)

A simple test to illustrate:

>>> import zipfile
>>> zinfo = zipfile.ZipInfo()
>>> repr(zinfo)
Traceback (most recent call last):
  File "", line 1, in 
  File "/cpython/Lib/zipfile.py", line 376, in __repr__
result.append(' file_size=%r' % self.file_size)
AttributeError: file_size

(If you assign zinfo.file_size = None, it next fails on compress_size.)

This problem has been noted before - see issues 3039 and 22217 - but has not 
been resolved.

Patch including tests is attached.

--
components: Library (Lib)
files: zipfile.ZipInfo.patch
keywords: patch
messages: 258859
nosy: Matthew Zipay
priority: normal
severity: normal
status: open
title: zipfile.ZipInfo slots can raise unexpected AttributeError
type: behavior
versions: Python 3.5, Python 3.6
Added file: http://bugs.python.org/file41698/zipfile.ZipInfo.patch

___
Python tracker 

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