GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Rewrite zipimport from scratch · Issue #69897 · python/cpython

Rewrite zipimport from scratch #69897

New issue
Copy link
New issue
Copy link
Closed
Closed
Rewrite zipimport from scratch#69897
Copy link
Labels
3.8 (EOL)end of lifeend of lifeinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)type-featureA feature request or enhancementA feature request or enhancement

Description

@brettcannon
brettcannon
opened on Nov 23, 2015
Issue body actions
BPO 25711
Nosy @Yhg1s, @warsaw, @brettcannon, @gpshead, @ncoghlan, @pmp-p, @ericsnowcurrently, @serhiy-storchaka, @dianaclarke, @AraHaan, @jarondl
PRs
  • bpo-25711: zipimport rewritten in Python #4023
  • bpo-25711: Rewrite zipimport in pure Python. #6809
  • bpo-25711: Remove outdated zipimport tests. #9404
  • bpo-25711: Move _ZipImportResourceReader from importlib to zipimport. #9406
  • bpo-32075: Expose ZipImporter Type Object in the include header files. #4470
  • Files
  • zipimport.patch
  • zipimport-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 = None
    closed_at = <Date 2018-11-05.13:48:52.968>
    created_at = <Date 2015-11-23.16:28:40.454>
    labels = ['interpreter-core', 'type-feature', '3.8']
    title = 'Rewrite zipimport from scratch'
    updated_at = <Date 2018-11-05.13:48:52.967>
    user = 'https://github.com/brettcannon'

    bugs.python.org fields:

    activity = <Date 2018-11-05.13:48:52.967>
    actor = 'serhiy.storchaka'
    assignee = 'none'
    closed = True
    closed_date = <Date 2018-11-05.13:48:52.968>
    closer = 'serhiy.storchaka'
    components = ['Interpreter Core']
    creation = <Date 2015-11-23.16:28:40.454>
    creator = 'brett.cannon'
    dependencies = []
    files = ['45800', '45814']
    hgrepos = []
    issue_num = 25711
    keywords = ['patch']
    message_count = 33.0
    messages = ['255183', '255198', '255202', '255224', '256161', '256171', '256207', '257360', '257609', '282731', '282776', '282777', '282871', '282876', '282938', '283130', '299705', '304484', '304531', '306556', '306610', '307524', '316536', '321267', '321289', '323750', '324445', '324453', '324456', '325672', '325706', '325771', '329294']
    nosy_count = 13.0
    nosy_names = ['twouters', 'barry', 'brett.cannon', 'gregory.p.smith', 'ncoghlan', 'pmpp', 'eric.snow', 'serhiy.storchaka', 'diana', 'superluser', 'byrnes', 'Decorater', 'jarondl']
    pr_nums = ['4023', '6809', '9404', '9406', '4470']
    priority = 'high'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue25711'
    versions = ['Python 3.8']

    Activity

    Next
    1. brettcannon commented on Nov 23, 2015

      @brettcannon
      brettcannon
      on Nov 23, 2015
      MemberAuthor
      More actions

      No one wants to work on zipimport, and yet it's full of bugs. It needs a rewrite so that it's more maintainable. An idea floated at PyCon 2015 was to writing the zip-reading code in C and to keep it as simple as possible -- e.g., don't worry about supporting comments, etc. -- and then write the rest of the code in importlib, making maintenance much easier.

      All of the various zipimport bugs should be made dependent on this issue as unless they are critical flaws I doubt they will get fixed without the rewrite.

    2. brettcannon
      added
      interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)
      on Nov 23, 2015
    3. serhiy-storchaka commented on Nov 23, 2015

      @serhiy-storchaka
      serhiy-storchaka
      on Nov 23, 2015
      Member
      More actions

      FYI I'm at the early stage of rewriting zipimport in Python.

    4. brettcannon commented on Nov 23, 2015

      @brettcannon
      brettcannon
      on Nov 23, 2015
      MemberAuthor
      More actions

      Are you writing it in such a way that it can be bootstspped in with importlib so the stslib can be loaded from it?

    5. serhiy-storchaka commented on Nov 23, 2015

      @serhiy-storchaka
      serhiy-storchaka
      on Nov 23, 2015
      Member
      More actions

      It was my intention.

    6. superluser commented on Dec 9, 2015

      @superluser
      superlusermannequin
      on Dec 9, 2015
      Mannequin
      More actions

      Serhiy, how far along are you on this? I have a wip from this summer that I could finish over the holidays.

    7. serhiy-storchaka commented on Dec 10, 2015

      @serhiy-storchaka
      serhiy-storchaka
      on Dec 10, 2015
      Member
      More actions

      I were on very early stage, and stopped this work few weeks ago in favor of other issues. I would be glad to make a review of your work when you have finished it Rose.

    8. vstinner commented on Dec 11, 2015

      @vstinner
      vstinner
      on Dec 11, 2015
      Member
      More actions

      Can you both publish your WIP work?

    9. brettcannon commented on Jan 2, 2016

      @brettcannon
      brettcannon
      on Jan 2, 2016
      MemberAuthor
      More actions

      What are people's statuses on their various attempts? Since this is going to block my importlib.resources work I will do the work myself or work directly with someone in order to make sure this gets done.

    10. superluser commented on Jan 6, 2016

      @superluser
      superlusermannequin
      on Jan 6, 2016
      Mannequin
      More actions

      Sorry for the late response. I didn't have much time over the holidays. I think I better let someone else take this one.

    11. serhiy-storchaka commented on Dec 8, 2016

      @serhiy-storchaka
      serhiy-storchaka
      on Dec 8, 2016
      Member
      More actions

      Here is preliminary translation of zipimport to Python. It is not frozen and imports other modules. I tried to keep the implementation close to C implementation. As a consequence, some raised exceptions look arbitrary.

    12. serhiy-storchaka
      added
      3.7 (EOL)end of lifeend of life
      type-featureA feature request or enhancementA feature request or enhancement
      on Dec 8, 2016
    13. serhiy-storchaka commented on Dec 9, 2016

      @serhiy-storchaka
      serhiy-storchaka
      on Dec 9, 2016
      Member
      More actions

      Got rid of dependencies from os, stat and encodings.

    14. vstinner commented on Dec 9, 2016

      @vstinner
      vstinner
      on Dec 9, 2016
      Member
      More actions

      Here is preliminary translation of zipimport to Python. It is not frozen and imports other modules.

      Technically, will it be possible to freeze it? It seems useful to keep the ability to put the whole stdlib into a single ZIP. Using a ZIP is sometimes suggested to avoid fstat() on disk for example, to speedup Python startup.

      But I also understand that the C code is painful to maintain and update.

      Anyway, nice job Serhiy :-)

    15. 10 remaining items

    16. serhiy-storchaka commented on May 14, 2018

      @serhiy-storchaka
      serhiy-storchaka
      on May 14, 2018
      Member
      More actions

      PR 6809 freezes zipimport.py, adds changes made in zipimport.c since writing the initial Python implementation, and fixes few bugs exposed in the frozen module. Seems Python now works with the zipped stdlib.

    17. serhiy-storchaka commented on Jul 8, 2018

      @serhiy-storchaka
      serhiy-storchaka
      on Jul 8, 2018
      Member
      More actions

      Could anybody please make a review? This is just a first step, we need to do it before making other steps: implementing more modern import API, supporting large ZIP files and ZIP files with comments, implementing loading binary extensions from ZIP files, etc.

    18. brettcannon commented on Jul 8, 2018

      @brettcannon
      brettcannon
      on Jul 8, 2018
      MemberAuthor
      More actions

      I'm planning to review the PR at some point.

      On Sun, Jul 8, 2018, 00:42 Serhiy Storchaka, <[email protected]> wrote:

      Serhiy Storchaka <[email protected]> added the comment:

      Could anybody please make a review? This is just a first step, we need to
      do it before making other steps: implementing more modern import API,
      supporting large ZIP files and ZIP files with comments, implementing
      loading binary extensions from ZIP files, etc.

      ----------


      Python tracker <[email protected]>
      <https://bugs.python.org/issue25711\>


    19. serhiy-storchaka commented on Aug 19, 2018

      @serhiy-storchaka
      serhiy-storchaka
      on Aug 19, 2018
      Member
      More actions

      Fixed issues on Windows.

    20. serhiy-storchaka
      added
      3.8 (EOL)end of lifeend of life
      and removed
      3.7 (EOL)end of lifeend of life
      on Aug 19, 2018
    21. brettcannon commented on Aug 31, 2018

      @brettcannon
      brettcannon
      on Aug 31, 2018
      MemberAuthor
      More actions

      I think Serhiy's PR is basically done, so now the question is do we want to merge it in and drop the C code? ;)

      I obviously say yes because this is I/O-bound code and so the switch shouldn't be enough of a performance hit to warrant blocking the gain in maintainability long-term (especially if we try to clean the module up slowly).

      Barry, since I know you work with zip files a lot at work did you want to check to make sure perf won't be an issue for your use-case?

    22. warsaw commented on Sep 1, 2018

      @warsaw
      warsaw
      on Sep 1, 2018
      Member
      More actions

      Not sure if I'll have time before the core sprints to check the implementation with shiv, but I can give it a try then. Do you mind waiting until then?

    23. brettcannon commented on Sep 1, 2018

      @brettcannon
      brettcannon
      on Sep 1, 2018
      MemberAuthor
      More actions

      I'm personally in no rush and I assume Serhiy isn't either with 3.8 cut-off quite a ways out, so I see no rush.

    24. serhiy-storchaka commented on Sep 18, 2018

      @serhiy-storchaka
      serhiy-storchaka
      on Sep 18, 2018
      Member
      More actions

      New changeset 79d1c2e by Serhiy Storchaka in branch 'master':
      bpo-25711: Rewrite zipimport in pure Python. (GH-6809)
      79d1c2e

    25. serhiy-storchaka commented on Sep 19, 2018

      @serhiy-storchaka
      serhiy-storchaka
      on Sep 19, 2018
      Member
      More actions

      New changeset 9da3961 by Serhiy Storchaka in branch 'master':
      bpo-25711: Move _ZipImportResourceReader from importlib to zipimport. (GH-9406)
      9da3961

    26. serhiy-storchaka commented on Sep 19, 2018

      @serhiy-storchaka
      serhiy-storchaka
      on Sep 19, 2018
      Member
      More actions

      New changeset b2984ab by Serhiy Storchaka in branch 'master':
      bpo-25711: Remove outdated zipimport tests. (GH-9404)
      b2984ab

    27. ncoghlan commented on Nov 5, 2018

      @ncoghlan
      ncoghlan
      on Nov 5, 2018
      Contributor
      More actions

      Noticed this was still open when reviewing Elvis's zipimport patch for bpo-34022.

      Given the Python implementation has been merged, should we close this as resolved, and open new issues for any further changes (performance or otherwise)?

    28. serhiy-storchaka
      closed this as completedon Nov 5, 2018
    29. ezio-melotti
      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.8 (EOL)end of lifeend of lifeinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)type-featureA feature request or enhancementA feature request or enhancement

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions

        You are visitor 01402503 — GeezerVison does not store the pages you look up.
        Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.