Skip to content

gh-144851: Fix __lazy_import__ crash with user-defined filters#144852

Merged
Yhg1s merged 8 commits intopython:mainfrom
johnslavik:fix-lazy-import-crash
Mar 2, 2026
Merged

gh-144851: Fix __lazy_import__ crash with user-defined filters#144852
Yhg1s merged 8 commits intopython:mainfrom
johnslavik:fix-lazy-import-crash

Conversation

@johnslavik
Copy link
Member

@johnslavik johnslavik commented Feb 15, 2026

Writing a test shortly, still in progress!

@johnslavik
Copy link
Member Author

Skipping news as this is still unreleased.

@johnslavik johnslavik changed the title gh-144851: Fix __lazy_import__ crash gh-144851: Fix __lazy_import__ crash with user-defined filters Feb 21, 2026
@johnslavik
Copy link
Member Author

Hold on, this flow is more complicated than I thought...

@johnslavik
Copy link
Member Author

johnslavik commented Feb 27, 2026

OK, it's fine. All paths are good. 👍🏽

EDIT: I'm not sure we run all tests in CI. I'm adding a test to test the test.

@johnslavik
Copy link
Member Author

We're not running test_lazy_imports in CI. I'm not sure if this is intended. I'll investigate further outside of this PR.

@Yhg1s Yhg1s merged commit 8bcb3ea into python:main Mar 2, 2026
45 checks passed
@bedevere-bot
Copy link

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot AMD64 Debian root 3.x (tier-1) has failed when building commit 8bcb3ea.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/#/builders/345/builds/13534) and take a look at the build logs.
  4. Check if the failure is related to this commit (8bcb3ea) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/#/builders/345/builds/13534

Summary of the results of the build (if available):

==

Click to see traceback logs
Traceback (most recent call last):
  File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/test/support/__init__.py", line 947, in gc_collect
    gc.collect()
    ~~~~~~~~~~^^
ResourceWarning: unclosed file <_io.FileIO name=13 mode='wb' closefd=True>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants