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

Adopt changes from importlib_resources 5.2 #88934

Closed
jaraco opened this issue Jul 29, 2021 · 9 comments
Closed

Adopt changes from importlib_resources 5.2 #88934

jaraco opened this issue Jul 29, 2021 · 9 comments
Assignees
Labels
3.11 only security fixes stdlib Python modules in the Lib dir

Comments

@jaraco
Copy link
Member

jaraco commented Jul 29, 2021

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']

    @jaraco
    Copy link
    Member Author

    jaraco commented Jul 29, 2021

    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.

    @jaraco jaraco added the 3.11 only security fixes label Jul 29, 2021
    @jaraco jaraco self-assigned this Jul 29, 2021
    @jaraco jaraco added stdlib Python modules in the Lib dir 3.11 only security fixes labels Jul 29, 2021
    @jaraco jaraco self-assigned this Jul 29, 2021
    @jaraco jaraco added the stdlib Python modules in the Lib dir label Jul 29, 2021
    @jaraco
    Copy link
    Member Author

    jaraco commented Jul 29, 2021

    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.

    @jaraco
    Copy link
    Member Author

    jaraco commented Jul 29, 2021

    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.

    @jaraco
    Copy link
    Member Author

    jaraco commented Jul 29, 2021

    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.

    @jaraco
    Copy link
    Member Author

    jaraco commented Jul 30, 2021

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

    @jaraco jaraco closed this as completed Jul 30, 2021
    @jaraco jaraco closed this as completed Jul 30, 2021
    @pablogsal
    Copy link
    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.

    @pablogsal pablogsal reopened this Jul 30, 2021
    @pablogsal pablogsal reopened this Jul 30, 2021
    @jaraco
    Copy link
    Member Author

    jaraco commented Jul 31, 2021

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

    @vstinner
    Copy link
    Member

    vstinner commented Sep 1, 2021

    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.

    @jaraco
    Copy link
    Member Author

    jaraco commented Sep 13, 2021

    Reported concern can be addressed in the new issue.

    @jaraco jaraco closed this as completed Sep 13, 2021
    @jaraco jaraco closed this as completed Sep 13, 2021
    @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
    3.11 only security fixes stdlib Python modules in the Lib dir
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants