René's URL Explorer Experiment


Title: gh-128384: Add thread-safe context manager to "warnings" module by nascheme · Pull Request #128300 · python/cpython · GitHub

Open Graph Title: gh-128384: Add thread-safe context manager to "warnings" module by nascheme · Pull Request #128300 · python/cpython

X Title: gh-128384: Add thread-safe context manager to "warnings" module by nascheme · Pull Request #128300 · python/cpython

Description: The Python programming language. Contribute to python/cpython development by creating an account on GitHub.

Open Graph Description: This PR adds a new thread-local (and async friendly) context manager that uses contextvars. The recommended pattern for new code that doesn't care about backwards compatibility would be: with ...

X Description: This PR adds a new thread-local (and async friendly) context manager that uses contextvars. The recommended pattern for new code that doesn't care about backwards compatibility would be: w...

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

X: @github

direct link

Domain: github.com

route-pattern/:user_id/:repository/pull/:id/commits(.:format)
route-controllerpull_requests
route-actioncommits
fetch-noncev2:f3640969-4f2b-087f-fe78-1980f596f38d
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idC6AC:1BB425:2CC2AEE:3CDB9FF:6A53C9DF
html-safe-nonce4b2d54cb12779b033a4b42489dcf2e5ed7312cccf4f1b5457ed2df16fb3c9ffa
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNkFDOjFCQjQyNToyQ0MyQUVFOjNDREI5RkY6NkE1M0M5REYiLCJ2aXNpdG9yX2lkIjoiNjkzMzE1NjM0MDk0NTg5Nzk1MSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac033bdccdce3b55d70f75ab77618f92ab45e2d5aa0e724d12c9a28cd59b299ccd
hovercard-subject-tagpull_request:2253782097
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/commits
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/python/cpython/pull/128300/commits
twitter:imagehttps://opengraph.githubassets.com/345d37b4cb700c8c5c8d5b234abec56fef14b69274b5a47f8d32041cf830dfd8/python/cpython/pull/128300
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/345d37b4cb700c8c5c8d5b234abec56fef14b69274b5a47f8d32041cf830dfd8/python/cpython/pull/128300
og:image:altThis PR adds a new thread-local (and async friendly) context manager that uses contextvars. The recommended pattern for new code that doesn't care about backwards compatibility would be: with ...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamenascheme
hostnamegithub.com
expected-hostnamegithub.com
Noneb9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb
turbo-cache-controlno-cache
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
release07a982c1d40157c619b364352b704c3ce66bb332
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/python/cpython/pull/128300/commits#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F128300%2Fcommits
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
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
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/open-source/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/open-source/accelerator
GitHub Starshttps://stars.github.com
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/enterprise/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%2F128300%2Fcommits
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%2Fcommits&source=header-repo&source_repo=python%2Fcpython
Reloadhttps://github.com/python/cpython/pull/128300/commits
Reloadhttps://github.com/python/cpython/pull/128300/commits
Reloadhttps://github.com/python/cpython/pull/128300/commits
Please reload this pagehttps://github.com/python/cpython/pull/128300/commits
python https://github.com/python
cpythonhttps://github.com/python/cpython
Please reload this pagehttps://github.com/python/cpython/pull/128300/commits
Notifications https://github.com/login?return_to=%2Fpython%2Fcpython
Fork 35k https://github.com/login?return_to=%2Fpython%2Fcpython
Star 73.8k 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.3k https://github.com/python/cpython/pulls
Actions https://github.com/python/cpython/actions
Projects https://github.com/python/cpython/projects
Security and quality 0 https://github.com/python/cpython/security
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 and quality https://github.com/python/cpython/security
Insights https://github.com/python/cpython/pulse
naschemehttps://github.com/nascheme
python:mainhttps://github.com/python/cpython/tree/main
nascheme:warnings_local_contexthttps://github.com/nascheme/cpython/tree/warnings_local_context
Conversationhttps://github.com/python/cpython/pull/128300
Commits9 (9)https://github.com/python/cpython/pull/128300/commits
Checkshttps://github.com/python/cpython/pull/128300/checks
Files changedhttps://github.com/python/cpython/pull/128300/files
gh-128384: Add thread-safe context manager to "warnings" modulehttps://github.com/python/cpython/pull/128300/commits#top
naschemehttps://github.com/nascheme
python:mainhttps://github.com/python/cpython/tree/main
nascheme:warnings_local_contexthttps://github.com/nascheme/cpython/tree/warnings_local_context
Add locking to warnings.py.https://github.com/python/cpython/pull/128300/commits/deb659dd1177e1a537fd25da94576e6e4ea32028
https://github.com/nascheme
naschemehttps://github.com/python/cpython/commits?author=nascheme
deb659dhttps://github.com/python/cpython/pull/128300/commits/deb659dd1177e1a537fd25da94576e6e4ea32028
https://github.com/python/cpython/tree/deb659dd1177e1a537fd25da94576e6e4ea32028
Add 'context' parameter to Thread.https://github.com/python/cpython/pull/128300/commits/902df7cc238b1060041b87ec22314d2594c92d11
https://github.com/nascheme
naschemehttps://github.com/python/cpython/commits?author=nascheme
902df7chttps://github.com/python/cpython/pull/128300/commits/902df7cc238b1060041b87ec22314d2594c92d11
https://github.com/python/cpython/tree/902df7cc238b1060041b87ec22314d2594c92d11
Make _contextvars a builtin module.https://github.com/python/cpython/pull/128300/commits/e61b40e6a9c3ae226115912e5afce44dc75db9de
https://github.com/nascheme
naschemehttps://github.com/python/cpython/commits?author=nascheme
e61b40ehttps://github.com/python/cpython/pull/128300/commits/e61b40e6a9c3ae226115912e5afce44dc75db9de
https://github.com/python/cpython/tree/e61b40e6a9c3ae226115912e5afce44dc75db9de
wip: warnings local_contexthttps://github.com/python/cpython/pull/128300/commits/3bac8d188cae7e17181f0e206bb9d2f4a75cb8fd
https://github.com/nascheme
naschemehttps://github.com/python/cpython/commits?author=nascheme
3bac8d1https://github.com/python/cpython/pull/128300/commits/3bac8d188cae7e17181f0e206bb9d2f4a75cb8fd
https://github.com/python/cpython/tree/3bac8d188cae7e17181f0e206bb9d2f4a75cb8fd
Rename function, add locking to _filters_mutated().https://github.com/python/cpython/pull/128300/commits/c7287ad8a86ae157bae77346656a3de1e0198e3e
https://github.com/nascheme
naschemehttps://github.com/python/cpython/commits?author=nascheme
c7287adhttps://github.com/python/cpython/pull/128300/commits/c7287ad8a86ae157bae77346656a3de1e0198e3e
https://github.com/python/cpython/tree/c7287ad8a86ae157bae77346656a3de1e0198e3e
Use re-entrant lock for warnings module.https://github.com/python/cpython/pull/128300/commits/152127603b0ba7012cb0bb7767a45d7b39b7ec39
https://github.com/nascheme
naschemehttps://github.com/python/cpython/commits?author=nascheme
1521276https://github.com/python/cpython/pull/128300/commits/152127603b0ba7012cb0bb7767a45d7b39b7ec39
https://github.com/python/cpython/tree/152127603b0ba7012cb0bb7767a45d7b39b7ec39
Make _warnings use _warnings_context.https://github.com/python/cpython/pull/128300/commits/e5c128a81e882ed7f023c32fd17db5189cb11f59
https://github.com/nascheme
naschemehttps://github.com/python/cpython/commits?author=nascheme
e5c128ahttps://github.com/python/cpython/pull/128300/commits/e5c128a81e882ed7f023c32fd17db5189cb11f59
https://github.com/python/cpython/tree/e5c128a81e882ed7f023c32fd17db5189cb11f59
Add unit tests for warnings.Contexthttps://github.com/python/cpython/pull/128300/commits/948a9e923723c2409114ca40dc096cc171399767
https://github.com/nascheme
naschemehttps://github.com/python/cpython/commits?author=nascheme
948a9e9https://github.com/python/cpython/pull/128300/commits/948a9e923723c2409114ca40dc096cc171399767
https://github.com/python/cpython/tree/948a9e923723c2409114ca40dc096cc171399767
Improve Context.resetwarnings().https://github.com/python/cpython/pull/128300/commits/fc20826cea9853888418e202c3ae1907260e9360
https://github.com/nascheme
naschemehttps://github.com/python/cpython/commits?author=nascheme
fc20826https://github.com/python/cpython/pull/128300/commits/fc20826cea9853888418e202c3ae1907260e9360
https://github.com/python/cpython/tree/fc20826cea9853888418e202c3ae1907260e9360
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.