Skip to content

Sync with importlib_metadata for Python 3.15 #132947

Closed

Description

@hugovk

The sync for Python 3.13 was with importlib_metadata 7.1.0: #117089 / #117094

The most recent update incorporated changes from importlib_metadata 7.2.1: #120911

@jaraco Are there any changes needed from importlib_metadata 8.6.1 before the Python 3.14 feature freeze on 2025-05-06? If so, please could you take care of it? Thank you!

Linked PRs

Activity

  1. added
    type-featureA feature request or enhancement
    stdlibStandard Library Python modules in the Lib/ directory
    3.14bugs and security fixes
    on Apr 25, 2025
  2. jaraco commented on Aug 12, 2025

    @jaraco
    Member

    Just getting to this in my backlog. Obviously the deadline has passed, so whatever changes are to be incorporated will need to happen in 3.15 (with bugfixes potentially backported). I hope to get to it at some point.

  3. self-assigned this
    on Aug 12, 2025
  4. changed the title [-]Sync with importlib_metadata for Python 3.14[/-] [+]Sync with importlib_metadata for Python 3.15[/+] on Aug 12, 2025
  5. added
    3.15bugs and security fixes
    and removed
    3.14bugs and security fixes
    on Aug 12, 2025
  6. jaraco commented on Aug 14, 2025

    @jaraco
    Member

    Today I stumbled on #124033.

  7. hugovk commented on Aug 15, 2025

    @hugovk
    MemberAuthor

    Oh look! I've approved it. Feel free to merge it as an incremental step towards 8.7, or update it to include up to 8.7 if you prefer.

  8. added a commit that references this issue on Aug 18, 2025
  9. jaraco commented on Aug 18, 2025

    @jaraco
    Member

    I'm going to close this for now, although I may re-open it or reference it should more changes be needed for Python 3.15.

  10. StanFromIreland commented on Aug 18, 2025

    @StanFromIreland
    Member

    This is causing multiple buildbot failures (how did our CI not catch this ?!).

  11. 15 remaining items

  12. jaraco commented on Aug 23, 2025

    @jaraco
    Member

    Builds are passing on that commit, so I'll restore one file then the other.

  13. jaraco commented on Aug 24, 2025

    @jaraco
    Member

    The changes in 2afc2e1 are implicated.

  14. jaraco commented on Aug 24, 2025

    @jaraco
    Member

    The problem occurs even after 9130df2, which has very few changes to the functionality. I'm beginning to wonder if it's the import order that's triggering the error.

  15. jaraco commented on Aug 24, 2025

    @jaraco
    Member

    In 939cf5a, I've reduced the diff of importlib.metadata.__init__ to almost nothing, but the tests still fail, so I'll keep going until they pass. I'm now thinking it might be the None response for missing metadata.

  16. jaraco commented on Aug 24, 2025

    @jaraco
    Member

    Simply disabling the test for missing metadata (9853179) allows the tests to pass. These tests have next to nothing to do with the tests for packages_distributions, where disabling those also prevents the failure.

    None of these findings indicates any cause of the underlying resource warning. It seems that disabling either 'test_missing_metadata' or 'test_packages_distributions_example2' allows the tests to pass.

    Given how tedious it is to replicate these failures and how elusive the cause seems to be, I'm tempted to just provide a workaround and leave the root cause to be discerned later.

  17. jaraco commented on Aug 25, 2025

    @jaraco
    Member

    Well, it seems that randomly disabling one of the two tests (102a43b) is insufficient to avoid the resource warning.

    I do see some tests passing that were failing before, which suggests that simply disabling test_missing_data is insufficient to suppress the issue. At this point, I'm out of good ideas and I'm going to just going to disable the one test we know fixes the issue.

  18. jaraco commented on Aug 25, 2025

    @jaraco
    Member

    Now I'm completely confused. Even with the most relevant test disabled, the resource warnings are still occurring. Maybe I'm just not detecting the buildbot correctly.

    Confirmed - I've yet to find a technique to adequately detect running under buildbot.

  19. jaraco commented on Aug 31, 2025

    @jaraco
    Member

    I kicked off a conversation to ask about identifying buildbots. It seems there's not currently any way to do that, so my intention is to for now disable the one test that's known to precipitate the issue (except maybe on GitHub actions) and to file a separate issue to track down the failure.

  20. added a commit that references this issue on Sep 1, 2025
  21. jaraco commented on Sep 1, 2025

    @jaraco
    Member

    Revised PR is merged with the workaround.

  22. hugovk commented on Sep 1, 2025

    @hugovk
    MemberAuthor

    Thank you!

  23. StanFromIreland commented on Sep 1, 2025

    @StanFromIreland
    Member

    Should this not be kept open till the workaround is fixed?

  24. jaraco commented on Sep 6, 2025

    @jaraco
    Member

    This issue was about bringing in the changes from importlib_metadata, which are now merged in the most recent PR. I specifically wanted to separate this issue from the emergent regression in buildbots, because they are seemingly loosely related. Although these changes were necessary to bring about the ResourceWarnings, they also appear not to be a direct cause but a proximate cause, and in the meantime, these changes are valuable even if the tests can't ever be made to pass in the buildbots.

    The issue tracking the ResourceWarnings is #138313.

  25. added a commit that references this issue on Sep 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

3.15bugs and security fixesstdlibStandard Library Python modules in the Lib/ directorytopic-importlibtype-featureA feature request or enhancement

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions