Skip to content

Comments

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

Merged
ZeroIntensity merged 2 commits intopython: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 intopython:3.14from
miss-islington:backport-fd6b639-3.14

Conversation

@miss-islington
Copy link
Contributor

@miss-islington miss-islington commented Feb 9, 2026

… function across multiple interpreters (pythonGH-144602)

(cherry picked from commit fd6b639)

Co-authored-by: Peter Bierma <[email protected]>
@ZeroIntensity
Copy link
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
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
Member

encukou commented Feb 12, 2026

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.14 Feb 16, 2026
49 checks passed
@miss-islington miss-islington deleted the backport-fd6b639-3.14 branch February 16, 2026 15:37
@ZeroIntensity ZeroIntensity added the needs backport to 3.13 bugs and security fixes label Feb 16, 2026
@miss-islington-app
Copy link

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

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

@ZeroIntensity ZeroIntensity 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) <[email protected]>
Co-authored-by: Peter Bierma <[email protected]>
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