Skip to content

Add support for removing zip entry in ZipInfo #84356

Closed

Description

@yudilevi2
mannequin
BPO 40175
Nosy @Yhg1s, @serhiy-storchaka, @aeros, @yudilevi2
PRs
  • bpo-6818: Add remove() in ZipInfo #19336
  • 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 = None
    closed_at = <Date 2020-04-04.10:20:54.650>
    created_at = <Date 2020-04-03.15:38:22.691>
    labels = ['type-feature', 'library', '3.9']
    title = 'Add support for removing zip entry in ZipInfo'
    updated_at = <Date 2020-04-04.10:20:54.649>
    user = 'https://github.com/yudilevi2'

    bugs.python.org fields:

    activity = <Date 2020-04-04.10:20:54.649>
    actor = 'yudilevi'
    assignee = 'none'
    closed = True
    closed_date = <Date 2020-04-04.10:20:54.650>
    closer = 'yudilevi'
    components = ['Library (Lib)']
    creation = <Date 2020-04-03.15:38:22.691>
    creator = 'yudilevi'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 40175
    keywords = ['patch']
    message_count = 6.0
    messages = ['365704', '365734', '365750', '365752', '365753', '365754']
    nosy_count = 5.0
    nosy_names = ['twouters', 'alanmcintyre', 'serhiy.storchaka', 'aeros', 'yudilevi']
    pr_nums = ['19336']
    priority = 'normal'
    resolution = 'duplicate'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue40175'
    versions = ['Python 3.9']

    Activity

    1. yudilevi2 commented on Apr 3, 2020

      yudilevi2mannequin
      MannequinAuthor

      ZipInfo currently only allow adding entries to zip archives but doesn't have the ability to remove entries from them - pretty useful feature.

    2. added
      stdlibStandard Library Python modules in the Lib/ directory
      type-featureA feature request or enhancement
      on Apr 3, 2020
    3. aeros commented on Apr 4, 2020

      @aeros
      Contributor

      ZipInfo currently only allow adding entries to zip archives but doesn't have the ability to remove entries from them - pretty useful feature.

      This public API enhancement seems substantial enough to warrant a python-ideas ML thread or topic in the "Ideas" category of discuss.python.org. It would help to demonstrate some real-world examples where one may want to programmatically remove entries.

      Also, added zipfile maintainers to the nosy list.

    4. serhiy-storchaka commented on Apr 4, 2020

      @serhiy-storchaka
      Member

      This is a duplicate of bpo-700858 and bpo-6818.

    5. aeros commented on Apr 4, 2020

      @aeros
      Contributor

      Serhiy Storchaka wrote:

      This is a duplicate of bpo-700858 and bpo-6818.

      It probably would have been better to mention it in bpo-6818, but IMO, those issues have been inactive long enough that it's reasonable to re-address the issue. zipfile is not an area of expertise for me though, so I can't say if anything substantial has changed for the arguments against it in bpo-6818 to no longer apply. That's partly why I suggested python-ideas or discuss.python.org.

    6. serhiy-storchaka commented on Apr 4, 2020

      @serhiy-storchaka
      Member

      There were other issues and discussions about this.

      The problem of removing a file from a ZIP archive is similar to the problem of removing a line from a file. It cannot be made efficiently, and it is not even always possible. In some cases it may be better (simpler, more efficient and robust) to copy a file line by line into a new file, skipping particular lines, and the same is true for a ZIP archive. In other cases you can truncate the file or the ZIP archive. Solution that is optimal in one case may be inappropriate in other case.

    7. yudilevi2 commented on Apr 4, 2020

      yudilevi2mannequin
      MannequinAuthor

      Sorry, I didn't see the old issue, let's move the discussion over there -
      https://bugs.python.org/issue6818

    8. transferred this issue fromon Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    No one assigned

      Labels

      3.9 (EOL)end of lifestdlibStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancement

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions