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.

classification
Title: Reprs for zipfile classes
Type: enhancement Stage: resolved
Components: Library (Lib) Versions: Python 3.5
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: serhiy.storchaka Nosy List: ezio.melotti, python-dev, serhiy.storchaka
Priority: normal Keywords: patch

Created on 2014-08-17 17:05 by serhiy.storchaka, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
zipfile_reprs.diff serhiy.storchaka, 2014-08-17 17:06 review
zipfile_reprs_2.patch serhiy.storchaka, 2014-08-21 06:48 review
Messages (5)
msg225451 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2014-08-17 17:05
Proposed patch implements __repr__() methods of three zipfile classes: ZipFile, ZipInfo and ZipExtFile. Example:

>>> import zipfile
>>> zf = zipfile.ZipFile('/usr/share/doc/texlive-base/support/makeindex/ind-src.zip')
>>> zf
<zipfile.ZipFile filename='/usr/share/doc/texlive-base/support/makeindex/ind-src.zip' mode='r'>
>>> zf.infolist()[:2]
[<ZipInfo filename='ind-src/' filemode=drwxr-xr-x external_attr=0x10>, <ZipInfo filename='ind-src/fig1.tex' compress_type=deflate filemode=-r--r--r-- external_attr=0x1 file_size=1553 compress_size=518>]
>>> zf.open('ind-src/fig1.tex')
<zipfile.ZipExtFile name='ind-src/fig1.tex' mode='r' compress_type=deflate>
msg225601 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2014-08-21 06:48
Updated patch addresses Berker's comments.
msg230132 - (view) Author: Ezio Melotti (ezio.melotti) * (Python committer) Date: 2014-10-28 09:20
LGTM
msg230244 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2014-10-29 20:53
New changeset 82fd95c2851b by Serhiy Storchaka in branch 'default':
Issue #22217: Implemented reprs of classes in the zipfile module.
https://hg.python.org/cpython/rev/82fd95c2851b
msg230245 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2014-10-29 21:01
Thank you Berker and Ezio for your reviews.
History
Date User Action Args
2022-04-11 14:58:07adminsetgithub: 66413
2014-10-29 21:01:42serhiy.storchakasetstatus: open -> closed
resolution: fixed
messages: + msg230245

stage: commit review -> resolved
2014-10-29 20:53:40python-devsetnosy: + python-dev
messages: + msg230244
2014-10-28 09:20:32ezio.melottisetnosy: + ezio.melotti

messages: + msg230132
stage: patch review -> commit review
2014-08-21 06:48:13serhiy.storchakasetfiles: + zipfile_reprs_2.patch

messages: + msg225601
2014-08-17 17:06:37serhiy.storchakasetfiles: + zipfile_reprs.diff
keywords: + patch
2014-08-17 17:05:43serhiy.storchakacreate