René's URL Explorer Experiment


Title: gh-76785: Add PyInterpreterConfig Helpers by ericsnowcurrently · Pull Request #117170 · python/cpython · GitHub

Open Graph Title: gh-76785: Add PyInterpreterConfig Helpers by ericsnowcurrently · Pull Request #117170 · python/cpython

X Title: gh-76785: Add PyInterpreterConfig Helpers by ericsnowcurrently · Pull Request #117170 · python/cpython

Description: These helpers make it easier to customize and inspect the config used to initialize interpreters. This is especially helpful in our tests. I found inspiration from the PyConfig API for the PyInterpreterConfig dict conversion stuff. One motivation is that, later, we may end up exposing the config via the PEP 734 module. As part of this PR I've also added a bunch of tests. Issue: gh-76785

Open Graph Description: These helpers make it easier to customize and inspect the config used to initialize interpreters. This is especially helpful in our tests. I found inspiration from the PyConfig API for the PyInt...

X Description: These helpers make it easier to customize and inspect the config used to initialize interpreters. This is especially helpful in our tests. I found inspiration from the PyConfig API for the PyInt...

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

X: @github

direct link

Domain: github.com

route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:07262528-62e1-4de1-f42b-a8d2bd841922
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idAECE:DE287:12B0146:1903AB9:696AD89B
html-safe-nonce29863e738656b5dca46f5da9113a845ae8196b6b625689c56b7745fb9e41234b
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBRUNFOkRFMjg3OjEyQjAxNDY6MTkwM0FCOTo2OTZBRDg5QiIsInZpc2l0b3JfaWQiOiIzNjg5NTMxMTI0MTI4MzQwMTIzIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac4a57d5f142fada694bf4615571662114d13a026de1f8f5634568b6902cce8a8a
hovercard-subject-tagpull_request:1787611566
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///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/python/cpython/pull/117170/files
twitter:imagehttps://avatars.githubusercontent.com/u/1152074?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/1152074?s=400&v=4
og:image:altThese helpers make it easier to customize and inspect the config used to initialize interpreters. This is especially helpful in our tests. I found inspiration from the PyConfig API for the PyInt...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None5f99f7c1d70f01da5b93e5ca90303359738944d8ab470e396496262c66e60b8d
turbo-cache-controlno-preview
diff-viewunified
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 full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release524a93f2c1f36522a3b4be4c110467ee4172245d
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/python/cpython/pull/117170/files#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F117170%2Ffiles
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%2F117170%2Ffiles
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%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=python%2Fcpython
Reloadhttps://github.com/python/cpython/pull/117170/files
Reloadhttps://github.com/python/cpython/pull/117170/files
Reloadhttps://github.com/python/cpython/pull/117170/files
python https://github.com/python
cpythonhttps://github.com/python/cpython
Please reload this pagehttps://github.com/python/cpython/pull/117170/files
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/117170/files
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
ericsnowcurrentlyhttps://github.com/ericsnowcurrently
python:mainhttps://github.com/python/cpython/tree/main
ericsnowcurrently:interpreter-config-helpershttps://github.com/ericsnowcurrently/cpython/tree/interpreter-config-helpers
Conversation 3 https://github.com/python/cpython/pull/117170
Commits 19 https://github.com/python/cpython/pull/117170/commits
Checks 0 https://github.com/python/cpython/pull/117170/checks
Files changed https://github.com/python/cpython/pull/117170/files
Please reload this pagehttps://github.com/python/cpython/pull/117170/files
gh-76785: Add PyInterpreterConfig Helpers https://github.com/python/cpython/pull/117170/files#top
Show all changes 19 commits https://github.com/python/cpython/pull/117170/files
bdaef6b Fix a comment. ericsnowcurrently Mar 7, 2024 https://github.com/python/cpython/pull/117170/commits/bdaef6b92c0be66cb60f22566fcba1b54237d264
6342635 Add PyInterpreterConfig helpers. ericsnowcurrently Mar 21, 2024 https://github.com/python/cpython/pull/117170/commits/6342635375bfa24bb30e1bfae80fead50a5916b9
c48dd00 Add config helpers to _testinternalcapi. ericsnowcurrently Mar 21, 2024 https://github.com/python/cpython/pull/117170/commits/c48dd00f4ceb53e3c86da3782b90b5e8c160ce60
0796fe9 Use the new helpers in run_in_subinterp_with_config(). ericsnowcurrently Mar 22, 2024 https://github.com/python/cpython/pull/117170/commits/0796fe99ad1a4f140f391dba57fa7721a5362553
8993b41 Move the PyInterpreterConfig utils to their own file. ericsnowcurrently Mar 22, 2024 https://github.com/python/cpython/pull/117170/commits/8993b41757dd2c3a250b3bb655d0ee28e55af22d
a113017 _PyInterpreterState_ResolveConfig() -> _PyInterpreterConfig_InitFromS… ericsnowcurrently Mar 22, 2024 https://github.com/python/cpython/pull/117170/commits/a1130179235e677cd9c84f4de092b32d1a05d260
fce72b8 _testinternalcapi.new_interpreter_config() -> _xxsubinterpreters.new_… ericsnowcurrently Mar 22, 2024 https://github.com/python/cpython/pull/117170/commits/fce72b818ae9c4c264df5c1bb9b2cc6b0ff0efd0
c52e484 _testinternalcapi.get_interpreter_config() -> _xxsubinterpreters.get_… ericsnowcurrently Mar 22, 2024 https://github.com/python/cpython/pull/117170/commits/c52e484172de0a7dd768f1db8402455d4578f524
a2983ce Call _PyInterpreterState_RequireIDRef() in _interpreters._incref(). ericsnowcurrently Mar 22, 2024 https://github.com/python/cpython/pull/117170/commits/a2983ceda47c57cc5655625a35cddc7dcb3f630d
05a081e _testinternalcapi.interpreter_incref() -> _interpreters._incref() ericsnowcurrently Mar 23, 2024 https://github.com/python/cpython/pull/117170/commits/05a081edecc3085324d8139e1ad28d55247d7292
8a39bbc Supporting passing a config to _xxsubinterpreters.create(). ericsnowcurrently Mar 22, 2024 https://github.com/python/cpython/pull/117170/commits/8a39bbc8a1b2add89d521367cd25da813c71498b
1173cd1 Factor out new_interpreter(). ericsnowcurrently Mar 22, 2024 https://github.com/python/cpython/pull/117170/commits/1173cd1cbb77b8abfe8d6d2079b9523788ec11c3
92c11d3 Fix test_import. ericsnowcurrently Mar 25, 2024 https://github.com/python/cpython/pull/117170/commits/92c11d388baf7648f781937405c790370bc74674
edda48d Fix an outdent. ericsnowcurrently Mar 25, 2024 https://github.com/python/cpython/pull/117170/commits/edda48dbe64ccc4d5e67f8eb60d0399935f59ea8
5f617ed Call _PyInterpreterState_RequireIDRef() in the right places. ericsnowcurrently Apr 1, 2024 https://github.com/python/cpython/pull/117170/commits/5f617ed2ed7a4b5dfb451e5f3846fb72951cb116
c504c79 Drop an unnecessary _PyInterpreterState_IDInitref() call. ericsnowcurrently Apr 1, 2024 https://github.com/python/cpython/pull/117170/commits/c504c79e3eccf8dac373fbf489c1da058691ef11
8a75c90 Reduce to just the new internal C-API. ericsnowcurrently Apr 2, 2024 https://github.com/python/cpython/pull/117170/commits/8a75c9002b0a1f52b64bb7ded652a4a6e48f4e58
a38cda7 Adjust test_get_config. ericsnowcurrently Apr 2, 2024 https://github.com/python/cpython/pull/117170/commits/a38cda7b9a3b7889404b1299ff5db6126260cd25
cae0482 Remove trailing whitespace. ericsnowcurrently Apr 2, 2024 https://github.com/python/cpython/pull/117170/commits/cae0482fb30925440202068823703ac78efc2974
Clear filters https://github.com/python/cpython/pull/117170/files
Please reload this pagehttps://github.com/python/cpython/pull/117170/files
Please reload this pagehttps://github.com/python/cpython/pull/117170/files
pycore_pylifecycle.h https://github.com/python/cpython/pull/117170/files#diff-654f110e8bb3ccaa35433482309c4552cd8d74958bfb8b780daa6222f8ab2859
__init__.py https://github.com/python/cpython/pull/117170/files#diff-d925268c057737ba320c489ca302fd5125f14840d22e50cfe226bdb5bb88ba8d
test_misc.py https://github.com/python/cpython/pull/117170/files#diff-4178d53cac5b09685584df43c65b66797dd4ca4df491b2081565d95ba90aaa36
__init__.py https://github.com/python/cpython/pull/117170/files#diff-ea25b7196846cae64e3ed2b3fb2e1ee420961442fcd801a07bcd9000178bbd58
Makefile.pre.in https://github.com/python/cpython/pull/117170/files#diff-1f0a8db227d22005511b0d90f5339b97db345917b863954b3b3ccb9ec308767c
_testinternalcapi.c https://github.com/python/cpython/pull/117170/files#diff-687f4a736f1f6ad4b6cd4ff65c8e0113408304e8d65530dbd41b3f59a081a126
_freeze_module.vcxproj https://github.com/python/cpython/pull/117170/files#diff-d6e731738eec137782f1f1add8cb8ae28cbe912b6bedfe170eb91e90c388702e
_freeze_module.vcxproj.filters https://github.com/python/cpython/pull/117170/files#diff-5e3a79d068beb7e72d27ca9ef4847037a9ee40a43dc221fe9868d41b7a9041ff
pythoncore.vcxproj https://github.com/python/cpython/pull/117170/files#diff-4295039788386c2986b811f2a6b59cf088be59822b24b4f1243c9e9b184f65fb
pythoncore.vcxproj.filters https://github.com/python/cpython/pull/117170/files#diff-9e715828befc9c50c8b483b06d4923cda0db44f57d0c20e6a6d428ba60bfa0c5
config_common.h https://github.com/python/cpython/pull/117170/files#diff-00c1c240d60b3d584d6a9e4cd9240e80edf8f5847b77b0f4d8e7c18f566bd6fc
initconfig.c https://github.com/python/cpython/pull/117170/files#diff-bde30a9f2283aadeea54d703778ec8edf01c71bac3cfe6479035fc13ddc3296b
interpconfig.c https://github.com/python/cpython/pull/117170/files#diff-4d045626df4e9cc3bbdfe286f377c2b3a1e871e74d2245fa46a09e43c51d0652
https://github.com/python/cpython/blob/main/.github/CODEOWNERS#L310
Include/internal/pycore_pylifecycle.hhttps://github.com/python/cpython/pull/117170/files#diff-654f110e8bb3ccaa35433482309c4552cd8d74958bfb8b780daa6222f8ab2859
View file https://github.com/ericsnowcurrently/cpython/blob/cae0482fb30925440202068823703ac78efc2974/Include/internal/pycore_pylifecycle.h
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/117170/{{ revealButtonHref }}
https://github.com/python/cpython/pull/117170/files#diff-654f110e8bb3ccaa35433482309c4552cd8d74958bfb8b780daa6222f8ab2859
https://github.com/python/cpython/pull/117170/files#diff-654f110e8bb3ccaa35433482309c4552cd8d74958bfb8b780daa6222f8ab2859
Lib/test/support/__init__.pyhttps://github.com/python/cpython/pull/117170/files#diff-d925268c057737ba320c489ca302fd5125f14840d22e50cfe226bdb5bb88ba8d
View file https://github.com/ericsnowcurrently/cpython/blob/cae0482fb30925440202068823703ac78efc2974/Lib/test/support/__init__.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/117170/{{ revealButtonHref }}
https://github.com/python/cpython/pull/117170/files#diff-d925268c057737ba320c489ca302fd5125f14840d22e50cfe226bdb5bb88ba8d
https://github.com/python/cpython/pull/117170/files#diff-d925268c057737ba320c489ca302fd5125f14840d22e50cfe226bdb5bb88ba8d
https://github.com/python/cpython/blob/main/.github/CODEOWNERS#L349
Lib/test/test_capi/test_misc.pyhttps://github.com/python/cpython/pull/117170/files#diff-4178d53cac5b09685584df43c65b66797dd4ca4df491b2081565d95ba90aaa36
View file https://github.com/ericsnowcurrently/cpython/blob/cae0482fb30925440202068823703ac78efc2974/Lib/test/test_capi/test_misc.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/117170/{{ revealButtonHref }}
https://github.com/python/cpython/pull/117170/files#diff-4178d53cac5b09685584df43c65b66797dd4ca4df491b2081565d95ba90aaa36
https://github.com/python/cpython/pull/117170/files#diff-4178d53cac5b09685584df43c65b66797dd4ca4df491b2081565d95ba90aaa36
https://github.com/python/cpython/blob/main/.github/CODEOWNERS#L260
Lib/test/test_import/__init__.pyhttps://github.com/python/cpython/pull/117170/files#diff-ea25b7196846cae64e3ed2b3fb2e1ee420961442fcd801a07bcd9000178bbd58
View file https://github.com/ericsnowcurrently/cpython/blob/cae0482fb30925440202068823703ac78efc2974/Lib/test/test_import/__init__.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/117170/{{ revealButtonHref }}
https://github.com/python/cpython/pull/117170/files#diff-ea25b7196846cae64e3ed2b3fb2e1ee420961442fcd801a07bcd9000178bbd58
https://github.com/python/cpython/pull/117170/files#diff-ea25b7196846cae64e3ed2b3fb2e1ee420961442fcd801a07bcd9000178bbd58
https://github.com/python/cpython/pull/117170/files#diff-ea25b7196846cae64e3ed2b3fb2e1ee420961442fcd801a07bcd9000178bbd58
https://github.com/python/cpython/blob/main/.github/CODEOWNERS#L84
Makefile.pre.inhttps://github.com/python/cpython/pull/117170/files#diff-1f0a8db227d22005511b0d90f5339b97db345917b863954b3b3ccb9ec308767c
View file https://github.com/ericsnowcurrently/cpython/blob/cae0482fb30925440202068823703ac78efc2974/Makefile.pre.in
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/117170/{{ revealButtonHref }}
https://github.com/python/cpython/pull/117170/files#diff-1f0a8db227d22005511b0d90f5339b97db345917b863954b3b3ccb9ec308767c
https://github.com/python/cpython/pull/117170/files#diff-1f0a8db227d22005511b0d90f5339b97db345917b863954b3b3ccb9ec308767c
https://github.com/python/cpython/pull/117170/files#diff-1f0a8db227d22005511b0d90f5339b97db345917b863954b3b3ccb9ec308767c
https://github.com/python/cpython/pull/117170/files#diff-1f0a8db227d22005511b0d90f5339b97db345917b863954b3b3ccb9ec308767c
Please reload this pagehttps://github.com/python/cpython/pull/117170/files
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.