Skip to content

Adopt changes from importlib_resources 5.2 #88934

Closed

Description

@jaraco
BPO 44771
Nosy @jaraco, @vstinner, @pablogsal, @FFY00
PRs
  • bpo-44771: Apply changes from importlib_resources 5.2.1 #27436
  • bpo-44771: "Revert apply changes from importlib_resources 5.2.1" #27483
  • bpo-44771: rename namespacedata01 to namespacedata #27484
  • bpo-44771: Sync with importlib_resources 5.2.2, fixing refleak. #27497
  • 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/jaraco'
    closed_at = <Date 2021-09-13.00:01:35.864>
    created_at = <Date 2021-07-29.02:48:53.503>
    labels = ['library', '3.11']
    title = 'Adopt changes from importlib_resources 5.2'
    updated_at = <Date 2021-09-13.00:01:35.863>
    user = 'https://github.com/jaraco'

    bugs.python.org fields:

    activity = <Date 2021-09-13.00:01:35.863>
    actor = 'jaraco'
    assignee = 'jaraco'
    closed = True
    closed_date = <Date 2021-09-13.00:01:35.864>
    closer = 'jaraco'
    components = ['Library (Lib)']
    creation = <Date 2021-07-29.02:48:53.503>
    creator = 'jaraco'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 44771
    keywords = ['patch']
    message_count = 9.0
    messages = ['398453', '398454', '398455', '398484', '398524', '398554', '398613', '400851', '401677']
    nosy_count = 4.0
    nosy_names = ['jaraco', 'vstinner', 'pablogsal', 'FFY00']
    pr_nums = ['27436', '27483', '27484', '27497']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue44771'
    versions = ['Python 3.11']

    Activity

    1. jaraco commented on Jul 29, 2021

      @jaraco
      MemberAuthor

      Importlib_resources 5.1 and 5.2 introduced the following changes (more details at https://importlib-resources.readthedocs.io/en/latest/history.html#v5-2-1):

      • Added simple module implementing adapters from a low-level resources reader interface to a TraversableResources interface.
      • Legacy API (path, contents, ...) is now supported entirely by the .files() API with a compatibility shim supplied for resource loaders without that functionality.

      Let's incorporate those into the stdlib version.

    2. self-assigned this
      on Jul 29, 2021
    3. added
      stdlibStandard Library Python modules in the Lib/ directory
      3.11only security fixes
      on Jul 29, 2021
    4. self-assigned this
      on Jul 29, 2021
    5. added
      stdlibStandard Library Python modules in the Lib/ directory
      on Jul 29, 2021
    6. jaraco commented on Jul 29, 2021

      @jaraco
      MemberAuthor

      I've put together a patch based on python/importlib_resources@3b24bd6307, and interestingly, the tests pass... which is a little concerning because in python/importlib_resources#221 (comment), I describe a compatibility concern that I believe will be present only on the CPython implementation. Before we merge the changes, I'd like to (a) address that concern and (b) ideally write a test that captures that concern.

    7. jaraco commented on Jul 29, 2021

      @jaraco
      MemberAuthor

      On further consideration, the concern I had may not be manifest in the implementation. It may be the _adapters.wrap_spec provides all the compatibility that's needed. I'll see if I can concoct an idiomatic case, but I may find that there's no concern at all.

    8. jaraco commented on Jul 29, 2021

      @jaraco
      MemberAuthor

      In this comment, I did more analysis and assuaged my own concerns about the implementation. Everything seems to be working as intended, thanks to the strong work by FFY00.

    9. jaraco commented on Jul 30, 2021

      @jaraco
      MemberAuthor

      New changeset aaa83cd by Jason R. Coombs in branch 'main':
      bpo-44771: Apply changes from importlib_resources 5.2.1 (GH-27436)
      aaa83cd

    10. pablogsal commented on Jul 30, 2021

      @pablogsal
      Member

      Seems that PR 27436 has broken several buildbots. For instance:

      https://buildbot.python.org/all/#/builders/350/builds/474

      Following our buildbot policy, we will sadly need to revert in 24 if is not fixed.

    11. jaraco commented on Jul 31, 2021

      @jaraco
      MemberAuthor

      New changeset e63e631 by Jason R. Coombs in branch 'main':
      bpo-44771: Sync with importlib_resources 5.2.2, fixing refleak. (bpo-27497)
      e63e631

    12. vstinner commented on Sep 1, 2021

      @vstinner
      Member

      test_importlib.test_read_bytes() is failing for 1 month on AMD64 Windows8.1 Non-Debug 3.x. Please see bpo-45078, the regression may be caused by the commit aaa83cd.

    13. jaraco commented on Sep 13, 2021

      @jaraco
      MemberAuthor

      Reported concern can be addressed in the new issue.

    14. 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

    Labels

    3.11only security fixesstdlibStandard Library Python modules in the Lib/ directory

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions