René's URL Explorer Experiment


Title: gh-127271: Replace use of PyCell_GET/SET by nascheme · Pull Request #127272 · python/cpython · GitHub

Open Graph Title: gh-127271: Replace use of PyCell_GET/SET by nascheme · Pull Request #127272 · python/cpython

X Title: gh-127271: Replace use of PyCell_GET/SET by nascheme · Pull Request #127272 · python/cpython

Description: These macros are not safe to use in the free-threaded build. Use PyCell_GetRef() and PyCell_SetTakeRef() instead. Add PyCell_GET to the free-threading howto table of APIs that return borrowed refs. Add critical sections to PyCell_GET and PyCell_SET. Fix some thread safety issues with cell objects: cell_richcompare, cell_repr, cell_set_contents needed some work. Add an addtional unit test module that tries to trigger data races for these. Issue: gh-127271

Open Graph Description: These macros are not safe to use in the free-threaded build. Use PyCell_GetRef() and PyCell_SetTakeRef() instead. Add PyCell_GET to the free-threading howto table of APIs that return borrowed refs...

X Description: These macros are not safe to use in the free-threaded build. Use PyCell_GetRef() and PyCell_SetTakeRef() instead. Add PyCell_GET to the free-threading howto table of APIs that return borrowed refs...

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

X: @github

direct link

Domain: github.com

route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:343e2596-a0ce-4307-5e86-b5681322415a
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-id80A8:2D3361:252DE64:35FF697:6A5668F6
html-safe-noncecfa42731ba9e8c62f704f42fb1b5afd207dfbb5e5395d791dbd95466595c8aa8
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4MEE4OjJEMzM2MToyNTJERTY0OjM1RkY2OTc6NkE1NjY4RjYiLCJ2aXNpdG9yX2lkIjoiMzIxMzAyNjc0NjI4ODIwNDAyMiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmacbfa1dea21d1f1e221fc9bec51b6d5d8b1ad834df112bcfb16b296bc265aa45a9
hovercard-subject-tagpull_request:2199525183
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/127272/files
twitter:imagehttps://avatars.githubusercontent.com/u/690853?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/690853?s=400&v=4
og:image:altThese macros are not safe to use in the free-threaded build. Use PyCell_GetRef() and PyCell_SetTakeRef() instead. Add PyCell_GET to the free-threading howto table of APIs that return borrowed refs...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None1bfcd903bf3318822b10b18a6332fac40d3a21f7d94456dca766ab8fa7328068
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
release37f446b78ad53e6f593aa1a4243b87c76a3428ab
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/python/cpython/pull/127272/files#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F127272%2Ffiles
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%2F127272%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/127272/files
Reloadhttps://github.com/python/cpython/pull/127272/files
Reloadhttps://github.com/python/cpython/pull/127272/files
Please reload this pagehttps://github.com/python/cpython/pull/127272/files
python https://github.com/python
cpythonhttps://github.com/python/cpython
Please reload this pagehttps://github.com/python/cpython/pull/127272/files
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
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
naschemehttps://github.com/nascheme
python:mainhttps://github.com/python/cpython/tree/main
nascheme:gh-127271-cell-get-sethttps://github.com/nascheme/cpython/tree/gh-127271-cell-get-set
Conversation 7 https://github.com/python/cpython/pull/127272
Commits 6 https://github.com/python/cpython/pull/127272/commits
Checks 0 https://github.com/python/cpython/pull/127272/checks
Files changed https://github.com/python/cpython/pull/127272/files
Please reload this pagehttps://github.com/python/cpython/pull/127272/files
gh-127271: Replace use of PyCell_GET/SET https://github.com/python/cpython/pull/127272/files#top
Show all changes 6 commits https://github.com/python/cpython/pull/127272/files
10ac6e6 gh-127271: Replace use of `PyCell_GET/SET` nascheme Nov 22, 2024 https://github.com/python/cpython/pull/127272/commits/10ac6e6be3da1387805894c0c9f1dee421e575e5
8a52275 Fix data races using PyCell_GetRef(). nascheme Nov 27, 2024 https://github.com/python/cpython/pull/127272/commits/8a52275136ab74c707028f39c3ab167bc4722cd6
95078c8 Fix thread safety issue with cell_set_contents(). nascheme Nov 26, 2024 https://github.com/python/cpython/pull/127272/commits/95078c871f8d80d49f4003c7f6847d8035591a49
10dba24 Add additional unit tests for free-threading. nascheme Nov 25, 2024 https://github.com/python/cpython/pull/127272/commits/10dba2479976698e5a68cb7c20ae1c00200581ea
b09c4cf Fix cell_richcompare in the case of NULLs. nascheme Nov 27, 2024 https://github.com/python/cpython/pull/127272/commits/b09c4cfe07485f68ac2381a6a518a6e3d5da0d81
04ee899 Add barrier to increase chance of data race. nascheme Dec 3, 2024 https://github.com/python/cpython/pull/127272/commits/04ee899d61dd90612305cbd5d36aaca7459e7d0f
Clear filters https://github.com/python/cpython/pull/127272/files
Please reload this pagehttps://github.com/python/cpython/pull/127272/files
Please reload this pagehttps://github.com/python/cpython/pull/127272/files
free-threading-extensions.rst https://github.com/python/cpython/pull/127272/files#diff-39a845503e7c6ba515fdd9565bc9aa9602b6b9e9ac180efc4cc7f03dc619b7d7
Python.h https://github.com/python/cpython/pull/127272/files#diff-f60ef9db994347493c9ad11a939d46272a5b9a3d03e9aa22f186a87dd9ce8769
cellobject.h https://github.com/python/cpython/pull/127272/files#diff-969657240dda284e463b8359c6d379dfd5baa9cf84a44fa58e1ff0b0a69ec23d
test_races.py https://github.com/python/cpython/pull/127272/files#diff-1e18dbe7edafebe908dbcd077e3d0a15dffcf31397971ecdb445801c6f6b3fa5
cellobject.c https://github.com/python/cpython/pull/127272/files#diff-f0df9ad069bc7da8c57b832bb39c9f5256abbfa7e558d64dbd70fececbfcf340
frameobject.c https://github.com/python/cpython/pull/127272/files#diff-7b8cef249e5cca077d30de4e428a6bde6b9b803464e790e9cffa7e052e19efdd
typeobject.c https://github.com/python/cpython/pull/127272/files#diff-1decebeef15f4e0b0ce106c665751ec55068d4d1d1825847925ad4f528b5b872
bltinmodule.c https://github.com/python/cpython/pull/127272/files#diff-e4fd8b8ee6a147f86c0719ff122aca6dfca36edbd4812c87892698b3b72e40a1
Doc/howto/free-threading-extensions.rsthttps://github.com/python/cpython/pull/127272/files#diff-39a845503e7c6ba515fdd9565bc9aa9602b6b9e9ac180efc4cc7f03dc619b7d7
View file https://github.com/nascheme/cpython/blob/04ee899d61dd90612305cbd5d36aaca7459e7d0f/Doc/howto/free-threading-extensions.rst
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/127272/{{ revealButtonHref }}
https://github.com/python/cpython/pull/127272/files#diff-39a845503e7c6ba515fdd9565bc9aa9602b6b9e9ac180efc4cc7f03dc619b7d7
https://github.com/python/cpython/pull/127272/files#diff-39a845503e7c6ba515fdd9565bc9aa9602b6b9e9ac180efc4cc7f03dc619b7d7
Include/Python.hhttps://github.com/python/cpython/pull/127272/files#diff-f60ef9db994347493c9ad11a939d46272a5b9a3d03e9aa22f186a87dd9ce8769
View file https://github.com/nascheme/cpython/blob/04ee899d61dd90612305cbd5d36aaca7459e7d0f/Include/Python.h
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/127272/{{ revealButtonHref }}
https://github.com/python/cpython/pull/127272/files#diff-f60ef9db994347493c9ad11a939d46272a5b9a3d03e9aa22f186a87dd9ce8769
https://github.com/python/cpython/pull/127272/files#diff-f60ef9db994347493c9ad11a939d46272a5b9a3d03e9aa22f186a87dd9ce8769
https://github.com/python/cpython/pull/127272/files#diff-f60ef9db994347493c9ad11a939d46272a5b9a3d03e9aa22f186a87dd9ce8769
https://github.com/python/cpython/pull/127272/files#diff-f60ef9db994347493c9ad11a939d46272a5b9a3d03e9aa22f186a87dd9ce8769
Include/cpython/cellobject.hhttps://github.com/python/cpython/pull/127272/files#diff-969657240dda284e463b8359c6d379dfd5baa9cf84a44fa58e1ff0b0a69ec23d
View file https://github.com/nascheme/cpython/blob/04ee899d61dd90612305cbd5d36aaca7459e7d0f/Include/cpython/cellobject.h
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/127272/{{ revealButtonHref }}
https://github.com/python/cpython/pull/127272/files#diff-969657240dda284e463b8359c6d379dfd5baa9cf84a44fa58e1ff0b0a69ec23d
https://github.com/python/cpython/pull/127272/files#diff-969657240dda284e463b8359c6d379dfd5baa9cf84a44fa58e1ff0b0a69ec23d
Lib/test/test_free_threading/test_races.pyhttps://github.com/python/cpython/pull/127272/files#diff-1e18dbe7edafebe908dbcd077e3d0a15dffcf31397971ecdb445801c6f6b3fa5
View file https://github.com/nascheme/cpython/blob/04ee899d61dd90612305cbd5d36aaca7459e7d0f/Lib/test/test_free_threading/test_races.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/127272/{{ revealButtonHref }}
Objects/cellobject.chttps://github.com/python/cpython/pull/127272/files#diff-f0df9ad069bc7da8c57b832bb39c9f5256abbfa7e558d64dbd70fececbfcf340
View file https://github.com/nascheme/cpython/blob/04ee899d61dd90612305cbd5d36aaca7459e7d0f/Objects/cellobject.c
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/127272/{{ revealButtonHref }}
https://github.com/python/cpython/pull/127272/files#diff-f0df9ad069bc7da8c57b832bb39c9f5256abbfa7e558d64dbd70fececbfcf340
https://github.com/python/cpython/pull/127272/files#diff-f0df9ad069bc7da8c57b832bb39c9f5256abbfa7e558d64dbd70fececbfcf340
https://github.com/python/cpython/pull/127272/files#diff-f0df9ad069bc7da8c57b832bb39c9f5256abbfa7e558d64dbd70fececbfcf340
https://github.com/python/cpython/pull/127272/files#diff-f0df9ad069bc7da8c57b832bb39c9f5256abbfa7e558d64dbd70fececbfcf340
https://github.com/python/cpython/blob/main/.github/CODEOWNERS#L216
Objects/frameobject.chttps://github.com/python/cpython/pull/127272/files#diff-7b8cef249e5cca077d30de4e428a6bde6b9b803464e790e9cffa7e052e19efdd
View file https://github.com/nascheme/cpython/blob/04ee899d61dd90612305cbd5d36aaca7459e7d0f/Objects/frameobject.c
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/127272/{{ revealButtonHref }}
https://github.com/python/cpython/pull/127272/files#diff-7b8cef249e5cca077d30de4e428a6bde6b9b803464e790e9cffa7e052e19efdd
https://github.com/python/cpython/pull/127272/files#diff-7b8cef249e5cca077d30de4e428a6bde6b9b803464e790e9cffa7e052e19efdd
https://github.com/python/cpython/pull/127272/files#diff-7b8cef249e5cca077d30de4e428a6bde6b9b803464e790e9cffa7e052e19efdd
https://github.com/python/cpython/pull/127272/files#diff-7b8cef249e5cca077d30de4e428a6bde6b9b803464e790e9cffa7e052e19efdd
https://github.com/python/cpython/pull/127272/files#diff-7b8cef249e5cca077d30de4e428a6bde6b9b803464e790e9cffa7e052e19efdd
https://github.com/python/cpython/pull/127272/files#diff-7b8cef249e5cca077d30de4e428a6bde6b9b803464e790e9cffa7e052e19efdd
https://github.com/python/cpython/pull/127272/files#diff-7b8cef249e5cca077d30de4e428a6bde6b9b803464e790e9cffa7e052e19efdd
https://github.com/python/cpython/pull/127272/files#diff-7b8cef249e5cca077d30de4e428a6bde6b9b803464e790e9cffa7e052e19efdd
Please reload this pagehttps://github.com/python/cpython/pull/127272/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.