Skip to content

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

Merged
Yhg1s merged 8 commits into
python: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 into
python:mainfrom
johnslavik:fix-lazy-import-crash

Conversation

@johnslavik

@johnslavikjohnslavik commented Feb 15, 2026

Copy link
Copy Markdown
Member

Writing a test shortly, still in progress!

@johnslavik

Copy link
Copy Markdown
MemberAuthor

Skipping news as this is still unreleased.

@johnslavikjohnslavik changed the title gh-144851: Fix __lazy_import__ crashgh-144851: Fix __lazy_import__ crash with user-defined filtersFeb 21, 2026
@johnslavik

Copy link
Copy Markdown
MemberAuthor

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

@johnslavik

johnslavik commented Feb 27, 2026

Copy link
Copy Markdown
MemberAuthor

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
Copy Markdown
MemberAuthor

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.

@brettcannon
brettcannon removed their request for review February 27, 2026 23:47
@Yhg1s
Yhg1s merged commit 8bcb3ea into python:mainMar 2, 2026
45 checks passed
@bedevere-bot

Copy link
Copy Markdown

⚠️⚠️⚠️ 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>

ljfp pushed a commit to ljfp/cpython that referenced this pull request Apr 25, 2026
@johnslavik
johnslavik deleted the fix-lazy-import-crash branch July 21, 2026 01:55
Sign up for freeto 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

@johnslavik@bedevere-bot@Yhg1s