Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reprs for zipfile classes #66413

Closed
serhiy-storchaka opened this issue Aug 17, 2014 · 5 comments
Closed

Reprs for zipfile classes #66413

serhiy-storchaka opened this issue Aug 17, 2014 · 5 comments
Assignees
Labels
stdlib Python modules in the Lib dir type-feature A feature request or enhancement

Comments

@serhiy-storchaka
Copy link
Member

BPO 22217
Nosy @ezio-melotti, @serhiy-storchaka
Files
  • zipfile_reprs.diff
  • zipfile_reprs_2.patch
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = 'https://github.com/serhiy-storchaka'
    closed_at = <Date 2014-10-29.21:01:42.500>
    created_at = <Date 2014-08-17.17:05:43.228>
    labels = ['type-feature', 'library']
    title = 'Reprs for zipfile classes'
    updated_at = <Date 2014-10-29.21:01:42.498>
    user = 'https://github.com/serhiy-storchaka'

    bugs.python.org fields:

    activity = <Date 2014-10-29.21:01:42.498>
    actor = 'serhiy.storchaka'
    assignee = 'serhiy.storchaka'
    closed = True
    closed_date = <Date 2014-10-29.21:01:42.500>
    closer = 'serhiy.storchaka'
    components = ['Library (Lib)']
    creation = <Date 2014-08-17.17:05:43.228>
    creator = 'serhiy.storchaka'
    dependencies = []
    files = ['36397', '36426']
    hgrepos = []
    issue_num = 22217
    keywords = ['patch']
    message_count = 5.0
    messages = ['225451', '225601', '230132', '230244', '230245']
    nosy_count = 3.0
    nosy_names = ['ezio.melotti', 'python-dev', 'serhiy.storchaka']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue22217'
    versions = ['Python 3.5']

    @serhiy-storchaka
    Copy link
    Member Author

    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>

    @serhiy-storchaka serhiy-storchaka self-assigned this Aug 17, 2014
    @serhiy-storchaka serhiy-storchaka added stdlib Python modules in the Lib dir type-feature A feature request or enhancement labels Aug 17, 2014
    @serhiy-storchaka
    Copy link
    Member Author

    Updated patch addresses Berker's comments.

    @ezio-melotti
    Copy link
    Member

    LGTM

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Oct 29, 2014

    New changeset 82fd95c2851b by Serhiy Storchaka in branch 'default':
    Issue bpo-22217: Implemented reprs of classes in the zipfile module.
    https://hg.python.org/cpython/rev/82fd95c2851b

    @serhiy-storchaka
    Copy link
    Member Author

    Thank you Berker and Ezio for your reviews.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    stdlib Python modules in the Lib dir type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants