[New-bugs-announce] [issue22217] Reprs for zipfile classes

Serhiy Storchaka report at bugs.python.org
Sun Aug 17 19:05:43 CEST 2014


New submission from Serhiy Storchaka:

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>

----------
assignee: serhiy.storchaka
components: Library (Lib)
messages: 225451
nosy: serhiy.storchaka
priority: normal
severity: normal
stage: patch review
status: open
title: Reprs for zipfile classes
type: enhancement
versions: Python 3.5

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue22217>
_______________________________________


More information about the New-bugs-announce mailing list