René's URL Explorer Experiment


Title: gh-109860: Use a New Thread State When Switching Interpreters, When Necessary by ericsnowcurrently · Pull Request #110245 · python/cpython · GitHub

Open Graph Title: gh-109860: Use a New Thread State When Switching Interpreters, When Necessary by ericsnowcurrently · Pull Request #110245 · python/cpython

X Title: gh-109860: Use a New Thread State When Switching Interpreters, When Necessary by ericsnowcurrently · Pull Request #110245 · python/cpython

Description: In a few places we switch to another interpreter without knowing if it has a thread state associated with the current thread. For the main interpreter there wasn't much of a problem, but for subin...

Open Graph Description: In a few places we switch to another interpreter without knowing if it has a thread state associated with the current thread. For the main interpreter there wasn't much of a problem, but for s...

X Description: In a few places we switch to another interpreter without knowing if it has a thread state associated with the current thread. For the main interpreter there wasn't much of a problem, but f...

Opengraph URL: https://github.com/python/cpython/pull/110245

X: @github

direct link

Domain: github.com

route-pattern/_view_fragments/voltron/pull_requests/show/:user_id/:repository/:id/pull_request_layout(.:format)
route-controllervoltron_pull_requests_fragments
route-actionpull_request_layout
fetch-noncev2:4dd39a77-661a-e692-ff64-86b6244a7889
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idA598:2603AD:D53011:119CEAF:696B5FA4
html-safe-nonce424ac9dbd780d3f5bd3949db3c8ba70fd371a1edbdae275ec2e8d333cdbeca7e
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNTk4OjI2MDNBRDpENTMwMTE6MTE5Q0VBRjo2OTZCNUZBNCIsInZpc2l0b3JfaWQiOiIyNDIzMzAzMjc5ODMxOTAwMDY4IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmacaa7a0ba99b96bce0b59b0a5bdba493e59c5d1a8b9d2c2104dc025bf880ffb0b6
hovercard-subject-tagpull_request:1538773422
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/pull_requests_fragments/pull_request_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/voltron/pull_requests/show/python/cpython/110245/pull_request_layout
twitter:imagehttps://opengraph.githubassets.com/76dfeb93f489025c2493bbcdda493d4c0e9a2ee7b6cbbaa0e9374e4a32cca595/python/cpython/pull/110245
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/76dfeb93f489025c2493bbcdda493d4c0e9a2ee7b6cbbaa0e9374e4a32cca595/python/cpython/pull/110245
og:image:altIn a few places we switch to another interpreter without knowing if it has a thread state associated with the current thread. For the main interpreter there wasn't much of a problem, but for s...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameericsnowcurrently
hostnamegithub.com
expected-hostnamegithub.com
None5f99f7c1d70f01da5b93e5ca90303359738944d8ab470e396496262c66e60b8d
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
release82560a55c6b2054555076f46e683151ee28a19bc
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/python/cpython/pull/110245#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F110245
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
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
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://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/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F110245
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fpull_requests_fragments%2Fpull_request_layout&source=header-repo&source_repo=python%2Fcpython
Reloadhttps://github.com/python/cpython/pull/110245
Reloadhttps://github.com/python/cpython/pull/110245
Reloadhttps://github.com/python/cpython/pull/110245
python https://github.com/python
cpythonhttps://github.com/python/cpython
Please reload this pagehttps://github.com/python/cpython/pull/110245
Notifications https://github.com/login?return_to=%2Fpython%2Fcpython
Fork 33.9k https://github.com/login?return_to=%2Fpython%2Fcpython
Star 71.1k https://github.com/login?return_to=%2Fpython%2Fcpython
Code https://github.com/python/cpython
Issues 5k+ https://github.com/python/cpython/issues
Pull requests 2.1k https://github.com/python/cpython/pulls
Actions https://github.com/python/cpython/actions
Projects 31 https://github.com/python/cpython/projects
Security Uh oh! There was an error while loading. Please reload this page. https://github.com/python/cpython/security
Please reload this pagehttps://github.com/python/cpython/pull/110245
Insights https://github.com/python/cpython/pulse
Code https://github.com/python/cpython
Issues https://github.com/python/cpython/issues
Pull requests https://github.com/python/cpython/pulls
Actions https://github.com/python/cpython/actions
Projects https://github.com/python/cpython/projects
Security https://github.com/python/cpython/security
Insights https://github.com/python/cpython/pulse
Sign up for GitHub https://github.com/signup?return_to=%2Fpython%2Fcpython%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fpython%2Fcpython%2Fissues%2Fnew%2Fchoose
Jump to bottomhttps://github.com/python/cpython/pull/110245#issue-comment-box
ericsnowcurrentlyhttps://github.com/ericsnowcurrently
python:mainhttps://github.com/python/cpython/tree/main
ericsnowcurrently:fix-using-wrong-tstatehttps://github.com/ericsnowcurrently/cpython/tree/fix-using-wrong-tstate
gh-109860: Use a New Thread State When Switching Interpreters, When Necessary https://github.com/python/cpython/pull/110245#top
ericsnowcurrentlyhttps://github.com/ericsnowcurrently
python:mainhttps://github.com/python/cpython/tree/main
ericsnowcurrently:fix-using-wrong-tstatehttps://github.com/ericsnowcurrently/cpython/tree/fix-using-wrong-tstate
Conversation 3 https://github.com/python/cpython/pull/110245
Commits 13 https://github.com/python/cpython/pull/110245/commits
Checks 0 https://github.com/python/cpython/pull/110245/checks
Files changed https://github.com/python/cpython/pull/110245/files
Please reload this pagehttps://github.com/python/cpython/pull/110245
https://github.co/hiddenchars
https://github.com/python/cpython/pull/{{ revealButtonHref }}
https://github.com/ericsnowcurrently
ericsnowcurrentlyhttps://github.com/ericsnowcurrently
Oct 2, 2023https://github.com/python/cpython/pull/110245#issue-1922765254
Please reload this pagehttps://github.com/python/cpython/pull/110245
PyThreadState Sometimes Used for Different Threads for Subinterpreters  #109860https://github.com/python/cpython/issues/109860
Please reload this pagehttps://github.com/python/cpython/pull/110245
ericsnowcurrentlyhttps://github.com/ericsnowcurrently
October 2, 2023 14:44https://github.com/python/cpython/pull/110245#commits-pushed-2117772
https://github.com/ericsnowcurrently
Add PyThreadState._whence.https://github.com/python/cpython/pull/110245/commits/2117772f65a3b749702655ffc3261565091e2102
2117772https://github.com/python/cpython/pull/110245/commits/2117772f65a3b749702655ffc3261565091e2102
https://github.com/ericsnowcurrently
Add an assert.https://github.com/python/cpython/pull/110245/commits/23828a342f3a3a3ef02fa79bea077742005a0252
23828a3https://github.com/python/cpython/pull/110245/commits/23828a342f3a3a3ef02fa79bea077742005a0252
https://github.com/ericsnowcurrently
Set up interp->_initial_thread for re-use.https://github.com/python/cpython/pull/110245/commits/b807906be130ae2b9c525815badc604e9be11413
b807906https://github.com/python/cpython/pull/110245/commits/b807906be130ae2b9c525815badc604e9be11413
https://github.com/ericsnowcurrently
Use a local PyThreadState in _PyInterpreterState_IDDecref().https://github.com/python/cpython/pull/110245/commits/3e10a5c08d84277ccbbf9b960bbac7962b8c129e
3e10a5chttps://github.com/python/cpython/pull/110245/commits/3e10a5c08d84277ccbbf9b960bbac7962b8c129e
https://github.com/ericsnowcurrently
Use a local PyThreadState in _xxsubinterpreters.https://github.com/python/cpython/pull/110245/commits/15e978a68b545e6e01f88f8b5c3840570b03e76b
15e978ahttps://github.com/python/cpython/pull/110245/commits/15e978a68b545e6e01f88f8b5c3840570b03e76b
https://github.com/ericsnowcurrently
Throw away the initial thread state.https://github.com/python/cpython/pull/110245/commits/0b60d6dd568b89b18dcbd73c5b3dd8affe6b929d
0b60d6dhttps://github.com/python/cpython/pull/110245/commits/0b60d6dd568b89b18dcbd73c5b3dd8affe6b929d
https://github.com/ericsnowcurrently
Use existing API.https://github.com/python/cpython/pull/110245/commits/781cb53c186965b6e3af868bf2803db8149d490d
781cb53https://github.com/python/cpython/pull/110245/commits/781cb53c186965b6e3af868bf2803db8149d490d
https://github.com/ericsnowcurrently
Release threading._main_thread._tstate_lock in _PyInterpreterState_Se…https://github.com/python/cpython/pull/110245/commits/cd288b5ff3e4c68f3fc8970c22d5726de88d55aa
cd288b5https://github.com/python/cpython/pull/110245/commits/cd288b5ff3e4c68f3fc8970c22d5726de88d55aa
https://github.com/ericsnowcurrently
Drop an assert (fork is messy).https://github.com/python/cpython/pull/110245/commits/4afdf7b57f090e8e00150723928aeb642370200e
4afdf7bhttps://github.com/python/cpython/pull/110245/commits/4afdf7b57f090e8e00150723928aeb642370200e
https://github.com/ericsnowcurrently
Add _PyInterpreterState_FailIfRunningMain().https://github.com/python/cpython/pull/110245/commits/aba79e38e5694010498e875b2c6219b01e51e4f0
aba79e3https://github.com/python/cpython/pull/110245/commits/aba79e38e5694010498e875b2c6219b01e51e4f0
https://github.com/ericsnowcurrently
Propagate "alraedy running" properly.https://github.com/python/cpython/pull/110245/commits/2c185543540c3e20dac5fc540d2eaca900bb0554
2c18554https://github.com/python/cpython/pull/110245/commits/2c185543540c3e20dac5fc540d2eaca900bb0554
https://github.com/ericsnowcurrently
Fix handling of no-memory in _sharedexception_bind().https://github.com/python/cpython/pull/110245/commits/845c2bd36c1bdf96dba060329b07a6f05f0225bd
845c2bdhttps://github.com/python/cpython/pull/110245/commits/845c2bd36c1bdf96dba060329b07a6f05f0225bd
https://github.com/ericsnowcurrently
Fix some typos.https://github.com/python/cpython/pull/110245/commits/fec49b2d301d0bb5d2a3166a5b310ca16d4f051d
fec49b2https://github.com/python/cpython/pull/110245/commits/fec49b2d301d0bb5d2a3166a5b310ca16d4f051d
https://github.com/ericsnowcurrently
ericsnowcurrentlyhttps://github.com/ericsnowcurrently
skip news https://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22skip%20news%22
needs backport to 3.12 https://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22needs%20backport%20to%203.12%22
Oct 2, 2023https://github.com/python/cpython/pull/110245#event-10530867374
https://github.com/apps/bedevere-app
bedevere-apphttps://github.com/apps/bedevere-app
awaiting review https://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22awaiting%20review%22
Oct 2, 2023https://github.com/python/cpython/pull/110245#event-10530867990
https://github.com/apps/bedevere-app
bedevere-apphttps://github.com/apps/bedevere-app
Oct 2, 2023 https://github.com/python/cpython/pull/110245#ref-issue-1911947964
PyThreadState Sometimes Used for Different Threads for Subinterpreters #109860 https://github.com/python/cpython/issues/109860
https://github.com/ericsnowcurrently
ericsnowcurrentlyhttps://github.com/ericsnowcurrently
f5198b0https://github.com/python/cpython/commit/f5198b09e16bca1886f8245fa88203d07d51ec11
Oct 3, 2023https://github.com/python/cpython/pull/110245#event-10539957658
https://github.com/miss-islington
miss-islingtonhttps://github.com/miss-islington
Oct 3, 2023https://github.com/python/cpython/pull/110245#issuecomment-1745202089
@ericsnowcurrentlyhttps://github.com/ericsnowcurrently
Please reload this pagehttps://github.com/python/cpython/pull/110245
https://github.com/apps/bedevere-app
bedevere-apphttps://github.com/apps/bedevere-app
awaiting review https://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22awaiting%20review%22
Oct 3, 2023https://github.com/python/cpython/pull/110245#event-10539958361
https://github.com/miss-islington
miss-islingtonhttps://github.com/miss-islington
Oct 3, 2023https://github.com/python/cpython/pull/110245#issuecomment-1745202214
@ericsnowcurrentlyhttps://github.com/ericsnowcurrently
cherry_pickerhttps://pypi.org/project/cherry-picker/
Please reload this pagehttps://github.com/python/cpython/pull/110245
https://github.com/ericsnowcurrently
ericsnowcurrentlyhttps://github.com/ericsnowcurrently
October 3, 2023 15:20https://github.com/python/cpython/pull/110245#event-10539959183
https://github.com/miss-islington
miss-islingtonhttps://github.com/miss-islington
ericsnowcurrentlyhttps://github.com/ericsnowcurrently
Oct 3, 2023https://github.com/python/cpython/pull/110245#event-10539959355
ericsnowcurrentlyhttps://github.com/ericsnowcurrently
Oct 11, 2023 https://github.com/python/cpython/pull/110245#ref-commit-0ec39ff
https://github.com/ericsnowcurrently
[3.12]https://github.com/ericsnowcurrently/cpython/commit/0ec39ff5c2372021f5a23665f44d3ef188836a62
pythongh-109860https://github.com/python/cpython/issues/109860
: Use a New Thread State When Switching Interpr…https://github.com/ericsnowcurrently/cpython/commit/0ec39ff5c2372021f5a23665f44d3ef188836a62
0ec39ffhttps://github.com/ericsnowcurrently/cpython/commit/0ec39ff5c2372021f5a23665f44d3ef188836a62
pythongh-110245https://github.com/python/cpython/pull/110245
f5198b0https://github.com/ericsnowcurrently/cpython/commit/f5198b09e16bca1886f8245fa88203d07d51ec11
https://github.com/apps/bedevere-app
bedevere-apphttps://github.com/apps/bedevere-app
Oct 11, 2023https://github.com/python/cpython/pull/110245#issuecomment-1757546724
GH-110709https://github.com/python/cpython/pull/110709
3.12 branchhttps://github.com/python/cpython/tree/3.12
Please reload this pagehttps://github.com/python/cpython/pull/110245
https://github.com/apps/bedevere-app
bedevere-apphttps://github.com/apps/bedevere-app
needs backport to 3.12 https://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22needs%20backport%20to%203.12%22
Oct 11, 2023https://github.com/python/cpython/pull/110245#event-10617790553
ericsnowcurrentlyhttps://github.com/ericsnowcurrently
Oct 12, 2023 https://github.com/python/cpython/pull/110245#ref-commit-9a3588e
https://github.com/ericsnowcurrently
[3.12]https://github.com/ericsnowcurrently/cpython/commit/9a3588e11e2cd0ec141bbfe19d60c62c1e0bdaaa
pythongh-109860https://github.com/python/cpython/issues/109860
: Use a New Thread State When Switching Interpr…https://github.com/ericsnowcurrently/cpython/commit/9a3588e11e2cd0ec141bbfe19d60c62c1e0bdaaa
9a3588ehttps://github.com/ericsnowcurrently/cpython/commit/9a3588e11e2cd0ec141bbfe19d60c62c1e0bdaaa
pythongh-110245https://github.com/python/cpython/pull/110245
f5198b0https://github.com/ericsnowcurrently/cpython/commit/f5198b09e16bca1886f8245fa88203d07d51ec11
Glyphackhttps://github.com/Glyphack
Sep 2, 2024 https://github.com/python/cpython/pull/110245#ref-commit-bf6f0e3
https://github.com/ericsnowcurrently
https://github.com/Glyphack
pythongh-109860https://github.com/python/cpython/issues/109860
: Use a New Thread State When Switching Interpreters, …https://github.com/Glyphack/cpython/commit/bf6f0e37553e639038b92ba024663d92113bf34d
bf6f0e3https://github.com/Glyphack/cpython/commit/bf6f0e37553e639038b92ba024663d92113bf34d
pythongh-110245https://github.com/python/cpython/pull/110245
Sign up for freehttps://github.com/join?source=comment-repo
Sign in to commenthttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F110245
https://github.com/ericsnowcurrently
ericsnowcurrently https://github.com/ericsnowcurrently
skip news https://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22skip%20news%22
Please reload this pagehttps://github.com/python/cpython/pull/110245
https://github.com/ericsnowcurrently
https://github.com/miss-islington
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.