René's URL Explorer Experiment


Title: Python 3.13 breaks circular imports through single-phase extension modules using non-isolated subinterpreters · Issue #138045 · python/cpython · GitHub

Open Graph Title: Python 3.13 breaks circular imports through single-phase extension modules using non-isolated subinterpreters · Issue #138045 · python/cpython

X Title: Python 3.13 breaks circular imports through single-phase extension modules using non-isolated subinterpreters · Issue #138045 · python/cpython

Description: Bug report Bug description: I believe this regression was caused by the changes made to fix gh-117953. Repro: import _interpreters interp = _interpreters.create() _interpreters.run_string(interp, "import numpy") Tested on Fedora 41 with ...

Open Graph Description: Bug report Bug description: I believe this regression was caused by the changes made to fix gh-117953. Repro: import _interpreters interp = _interpreters.create() _interpreters.run_string(interp, "...

X Description: Bug report Bug description: I believe this regression was caused by the changes made to fix gh-117953. Repro: import _interpreters interp = _interpreters.create() _interpreters.run_string(interp, &...

Opengraph URL: https://github.com/python/cpython/issues/138045

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Python 3.13 breaks circular imports through single-phase extension modules using non-isolated subinterpreters","articleBody":"# Bug report\n\n### Bug description:\n\nI believe this regression was caused by the changes made to fix gh-117953.\n\nRepro:\n```python\nimport _interpreters\ninterp = _interpreters.create()\n_interpreters.run_string(interp, \"import numpy\")\n```\n\nTested on Fedora 41 with Python 3.13.5 and numpy 1.26.4, and Fedora 42 with 3.13.7 and 2.2.6, respectively.\n\nWhat happens is that:\n* The subinterpreter tries to load `numpy`\n* Numpy loads a bunch of Python modules\n* numpy eventually tries to load the `multiarray` extension\n* import_run_extension switches to the main interpreter, as explained in the comment\n* The module init is called in the main interpreter\n* PyInit__multiarray_umath actually initializes in the main interpreter\n* initialize_static_globals() attempts to load some numpy Python modules from inside the extension\n* Since these modules aren't loaded in the main interpreter yet, the whole process starts over again loading `numpy`, now in the main interpreter\n* This then leads to loading the `multiarray` extension *again*, this time already in the main interpreter, so no switching happens\n* Python *reentrantly* attempts to initialize the (single-phase!) extension module in the main interpreter again\n* Kaboom\n\nThe easiest way to see the carnage in action is to run it under gdb and break on `PyInit__multiarray_umath`. You'll see it gets called twice, the second time reentrantly (with a 276-frame backtrace going through numpy initialization twice). If you don't set any breakpoints, you'll get crashes trying to process exceptions and other craziness when the original reentrant execution backtrace is long gone.\n\nnumpy does not support subinterpreters, but I would expect it to work when it is used in a single subinterpreter without isolation.\n\nThis is the root cause for:\n* https://tracker.ceph.com/issues/67696\n* https://bugzilla.redhat.com/show_bug.cgi?id=2307587\n\n\n### CPython versions tested on:\n\n3.13\n\n### Operating systems tested on:\n\nLinux\n\n\u003c!-- gh-linked-prs -->\n### Linked PRs\n* gh-142979\n\u003c!-- /gh-linked-prs -->\n","author":{"url":"https://github.com/marcan","@type":"Person","name":"marcan"},"datePublished":"2025-08-22T08:23:59Z","url":"https://github.com/python/cpython/issues/138045"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:32f5c993-525b-5b7b-7294-e4c101150e66
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idD60C:1C3DC0:9335D3:C4D211:6B004223
html-safe-nonce742f855020a67d411b88ca06f800ec675ce132063f35a916709403a7f01ef0f3
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJENjBDOjFDM0RDMDo5MzM1RDM6QzREMjExOjZCMDA0MjIzIiwidmlzaXRvcl9pZCI6IjgwODM1ODE5NDk4NzQwMjkwOTEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmacc17a3e9cdb9aab86c674512b1289d111c5c254cec91cc3046241727be8a64a1b
hovercard-subject-tagissue:3344623987
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/138045/issue_layout
twitter:imagehttps://opengraph.githubassets.com/67b1c6b63232620f9ef18e4f325c96e0997298556f1d39e4265ad32bd2cddf18/python/cpython/issues/138045
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/67b1c6b63232620f9ef18e4f325c96e0997298556f1d39e4265ad32bd2cddf18/python/cpython/issues/138045
og:image:altBug report Bug description: I believe this regression was caused by the changes made to fix gh-117953. Repro: import _interpreters interp = _interpreters.create() _interpreters.run_string(interp, "...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamemarcan
hostnamegithub.com
expected-hostnamegithub.com
None7d0829bbde9e48b2486cb5dd6d147896eb01d32134627091f818958a935ef3f0
turbo-cache-controlno-preview
go-importgithub.com/python/cpython git https://github.com/python/cpython.git
octolytics-dimension-user_id1525981
octolytics-dimension-user_loginpython
octolytics-dimension-repository_id81598961
octolytics-dimension-repository_nwopython/cpython
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id81598961
octolytics-dimension-repository_network_root_nwopython/cpython
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releasef3f3a43ca095cdea3abbb394112e971f9fdb94fa
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/python/cpython/issues/138045#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fissues%2F138045
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fissues%2F138045
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=python%2Fcpython
Reloadhttps://github.com/python/cpython/issues/138045
Reloadhttps://github.com/python/cpython/issues/138045
Reloadhttps://github.com/python/cpython/issues/138045
pythonhttps://github.com/python
cpythonhttps://github.com/python/cpython
Codehttps://github.com/python/cpython
Issues5k+ (5k+)https://github.com/python/cpython/issues
Pull requests2.4k (2.4k)https://github.com/python/cpython/pulls
Actionshttps://github.com/python/cpython/actions
Projectshttps://github.com/python/cpython/projects
Security and qualityhttps://github.com/python/cpython/security
Insightshttps://github.com/python/cpython/insights
https://github.com/python/cpython
New issuehttps://github.com/login?return_to=https://github.com/python/cpython/issues/138045
New issuehttps://github.com/login?return_to=https://github.com/python/cpython/issues/138045
Python 3.13 breaks circular imports through single-phase extension modules using non-isolated subinterpretershttps://github.com/python/cpython/issues/138045#top
https://github.com/ZeroIntensity
3.13only security fixeshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%223.13%22
3.14bugs and security fixeshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%223.14%22
3.15bugs and security fixeshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%223.15%22
extension-modulesC modules in the Modules dirhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22extension-modules%22
topic-subinterpretershttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22topic-subinterpreters%22
type-bugAn unexpected behavior, bug, or errorhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-bug%22
https://github.com/marcan
marcanhttps://github.com/marcan
on Aug 22, 2025https://github.com/python/cpython/issues/138045#issue-3344623987
gh-117953https://github.com/python/cpython/issues/117953
https://tracker.ceph.com/issues/67696https://tracker.ceph.com/issues/67696
https://bugzilla.redhat.com/show_bug.cgi?id=2307587https://bugzilla.redhat.com/show_bug.cgi?id=2307587
gh-138045: Fix importing numpy in legacy subinterpreters by skipping switch to main interpreter when not needed #142979https://github.com/python/cpython/pull/142979
marcanhttps://github.com/marcan
type-bugAn unexpected behavior, bug, or errorhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-bug%22
on Aug 22, 2025https://github.com/python/cpython/issues/138045#event-19282639568
picnixzhttps://github.com/picnixz
extension-modulesC modules in the Modules dirhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22extension-modules%22
topic-subinterpretershttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22topic-subinterpreters%22
3.13only security fixeshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%223.13%22
3.14bugs and security fixeshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%223.14%22
3.15bugs and security fixeshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%223.15%22
on Aug 22, 2025https://github.com/python/cpython/issues/138045#event-19282655869
github-project-automationhttps://github.com/apps/github-project-automation
Subinterpretershttps://github.com/orgs/python/projects/3
on Aug 22, 2025https://github.com/python/cpython/issues/138045
github-project-automationhttps://github.com/apps/github-project-automation
Subinterpretershttps://github.com/orgs/python/projects/3
on Aug 22, 2025https://github.com/python/cpython/issues/138045#event-19282657144
https://github.com/marcan
marcanhttps://github.com/marcan
on Aug 22, 2025https://github.com/python/cpython/issues/138045#issuecomment-3213577226
gh-117953https://github.com/python/cpython/issues/117953
gh-118157https://github.com/python/cpython/pull/118157
https://github.com/ZeroIntensity
ZeroIntensityhttps://github.com/ZeroIntensity
on Aug 22, 2025https://github.com/python/cpython/issues/138045#issuecomment-3214416957
https://github.com/marcan
marcanhttps://github.com/marcan
on Aug 22, 2025https://github.com/python/cpython/issues/138045#issuecomment-3214464031
ZeroIntensityhttps://github.com/ZeroIntensity
on Aug 22, 2025https://github.com/python/cpython/issues/138045#event-19288271639
https://github.com/marcan
marcanhttps://github.com/marcan
on Aug 23, 2025https://github.com/python/cpython/issues/138045#issuecomment-3216214055
ProxBothttps://github.com/ProxBot
on Sep 11, 2025https://github.com/python/cpython/issues/138045#event-19629701582
pybind/rbd: disable on_progress callbacks to prevent MGR segfaultshttps://github.com/proxmox/ceph/commit/35f5f7f91776ccba31254fc47e9359b94580b4a0
35f5f7fhttps://github.com/proxmox/ceph/commit/35f5f7f91776ccba31254fc47e9359b94580b4a0
https://github.com/jan-hasse
jan-hassehttps://github.com/jan-hasse
on Nov 10, 2025https://github.com/python/cpython/issues/138045#issuecomment-3510193042
@marcanhttps://github.com/marcan
@ericsnowcurrentlyhttps://github.com/ericsnowcurrently
https://github.com/ZeroIntensity
ZeroIntensityhttps://github.com/ZeroIntensity
on Nov 14, 2025https://github.com/python/cpython/issues/138045#issuecomment-3532336954
@jan-hassehttps://github.com/jan-hasse
#131229https://github.com/python/cpython/issues/131229
jan-hassehttps://github.com/jan-hasse
on Dec 19, 2025https://github.com/python/cpython/issues/138045#event-21671728666
pythongh-138045: Fix importing numpy in legacy subinterpreters by ski…https://github.com/jan-hasse/cpython/commit/ccbd2b95399b48764b0a2f7d7b1eb0f9c7478788
pythongh-138045https://github.com/python/cpython/issues/138045
ccbd2b9https://github.com/jan-hasse/cpython/commit/ccbd2b95399b48764b0a2f7d7b1eb0f9c7478788
https://github.com/jan-hasse
jan-hassehttps://github.com/jan-hasse
on Dec 19, 2025https://github.com/python/cpython/issues/138045#issuecomment-3675269881
https://github.com/marcan
marcanhttps://github.com/marcan
on Dec 30, 2025https://github.com/python/cpython/issues/138045#issuecomment-3698366599
jan-hassehttps://github.com/jan-hasse
on Jan 2, 2026https://github.com/python/cpython/issues/138045#event-21824939132
pythongh-138045: Fix importing numpy in legacy subinterpreters by ski…https://github.com/jan-hasse/cpython/commit/6f371d05c2036156f800f2d552cf602eab805a69
pythongh-138045https://github.com/python/cpython/issues/138045
6f371d0https://github.com/jan-hasse/cpython/commit/6f371d05c2036156f800f2d552cf602eab805a69
https://github.com/ZeroIntensity
ZeroIntensityhttps://github.com/ZeroIntensity
on Feb 16, 2026https://github.com/python/cpython/issues/138045#issuecomment-3909777527
#144602https://github.com/python/cpython/pull/144602
#144602https://github.com/python/cpython/pull/144602
@jan-hassehttps://github.com/jan-hasse
ZeroIntensityhttps://github.com/ZeroIntensity
completedhttps://github.com/python/cpython/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Feb 16, 2026https://github.com/python/cpython/issues/138045#event-22831913589
github-project-automationhttps://github.com/apps/github-project-automation
Subinterpretershttps://github.com/orgs/python/projects/3
on Feb 16, 2026https://github.com/python/cpython/issues/138045
Sign up for freehttps://github.com/signup?return_to=https://github.com/python/cpython/issues/138045
Sign in to commenthttps://github.com/login?return_to=https://github.com/python/cpython/issues/138045
ZeroIntensityhttps://github.com/ZeroIntensity
3.13only security fixeshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%223.13%22
3.14bugs and security fixeshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%223.14%22
3.15bugs and security fixeshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%223.15%22
extension-modulesC modules in the Modules dirhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22extension-modules%22
topic-subinterpretershttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22topic-subinterpreters%22
type-bugAn unexpected behavior, bug, or errorhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-bug%22
Subinterpretershttps://github.com/orgs/python/projects/3
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.