Skip to content

[3.14] gh-144601: Avoid sharing exception objects raised in a PyInit function across multiple interpreters (GH-144602) - #144633

Merged
ZeroIntensity merged 2 commits into
python:3.14from
miss-islington:backport-fd6b639-3.14
Feb 16, 2026
Merged

[3.14] gh-144601: Avoid sharing exception objects raised in a PyInit function across multiple interpreters (GH-144602)#144633
ZeroIntensity merged 2 commits into
python:3.14from
miss-islington:backport-fd6b639-3.14

Conversation

@miss-islington

@miss-islingtonmiss-islington commented Feb 9, 2026

Copy link
Copy Markdown
Contributor

… function across multiple interpreters (pythonGH-144602)
(cherry picked from commit fd6b639)
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
@ZeroIntensity

Copy link
Copy Markdown
Member

Hm, I'm very confused as to why the test is failing here, especially since this worked fine on main. I'll investigate tomorrow.

@ZeroIntensity
ZeroIntensity marked this pull request as draft February 10, 2026 02:29
@ZeroIntensity

Copy link
Copy Markdown
Member

Ah, found the problem. The issue is that in <3.15, there's an unused import to _testsinglephase in test_importlib.util, so import_extension_from_file can't even be imported from the subinterpreter:

_testsinglephase=import_helper.import_module("_testsinglephase")

This was removed on main by #141785, but that wasn't backported. @encukou -- I'm not familiar with _testmultiphase. Is there any reason we can't switch to also importing _testmultiphase on 3.14?

@encukou

Copy link
Copy Markdown
Member

None that I can think of.
Sorry that I embedded that in a bigger change. I'd be happy to review a partial backport.

@ZeroIntensity
ZeroIntensity marked this pull request as ready for review February 16, 2026 15:34
@ZeroIntensity
ZeroIntensity merged commit 907958c into python:3.14Feb 16, 2026
49 checks passed
@miss-islington
miss-islington deleted the backport-fd6b639-3.14 branch February 16, 2026 15:37
@ZeroIntensityZeroIntensity added the needs backport to 3.13 bugs and security fixes label Feb 16, 2026
@miss-islington-app

Copy link
Copy Markdown

Thanks @miss-islington for the PR, and @ZeroIntensity for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13.
🐍🍒⛏🤖

@miss-islington-app

Copy link
Copy Markdown

Sorry, @miss-islington and @ZeroIntensity, I could not cleanly backport this to 3.13 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker 907958c4ba3f310d18810f7132f1ecd6798dd5c5 3.13

@ZeroIntensityZeroIntensity removed the needs backport to 3.13 bugs and security fixes label Feb 16, 2026
ZeroIntensity added a commit to ZeroIntensity/cpython that referenced this pull request Feb 16, 2026
…PyInit` function across multiple interpreters (pythonGH-144602) (pythonGH-144633)
pythongh-144601: Avoid sharing exception objects raised in a `PyInit` function across multiple interpreters (pythonGH-144602)
(cherry picked from commit fd6b639)
(cherry picked from commit 907958c)
Co-authored-by: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
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

@miss-islington@ZeroIntensity@encukou