René's URL Explorer Experiment


Title: Incorrect error handling for APIs that can raise exceptions · Issue #105375 · python/cpython · GitHub

Open Graph Title: Incorrect error handling for APIs that can raise exceptions · Issue #105375 · python/cpython

X Title: Incorrect error handling for APIs that can raise exceptions · Issue #105375 · python/cpython

Description: For example, in the collation callback two str objects (string1 and string2) are created using PyUnicode_FromStringAndSize. Error handling should happen directly after each call to PyUnicode_FromStringAndSize: cpython/Modules/_sqlite/con...

Open Graph Description: For example, in the collation callback two str objects (string1 and string2) are created using PyUnicode_FromStringAndSize. Error handling should happen directly after each call to PyUnicode_FromSt...

X Description: For example, in the collation callback two str objects (string1 and string2) are created using PyUnicode_FromStringAndSize. Error handling should happen directly after each call to PyUnicode_FromSt...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Incorrect error handling for APIs that can raise exceptions","articleBody":"For example, in the collation callback two `str` objects (`string1` and `string2`) are created using `PyUnicode_FromStringAndSize`. Error handling should happen directly after each call to `PyUnicode_FromStringAndSize`:\r\n\r\nhttps://github.com/python/cpython/blob/0cb6b9b0db5df6b3f902e86eb3d4a1e504afb851/Modules/_sqlite/connection.c#L1870-L1875\r\n\r\nOther cases where error handling is not done immediately after the API has been used:\r\n\r\n- [x] gh-105491\r\n- [x] gh-105494\r\n- [x] gh-105585\r\n- [x] gh-105590\r\n- [x] gh-105591\r\n- [x] gh-105592\r\n- [x] gh-105593\r\n- [x] gh-105594\r\n- [x] gh-105667\r\n- [x] gh-105475 \r\n- [x] gh-105599\r\n- [x] gh-105586\r\n- [x] gh-105604\r\n- [x] gh-105606\r\n- [x] gh-105605\r\n- [x] gh-105608\r\n- [x] gh-105610\r\n- [x] gh-105611\r\n\r\nI might have missed some; I did not do a complete audit yet.\r\n\r\n\u003c!-- gh-linked-prs --\u003e\r\n### Linked PRs\r\n* gh-105412\r\n* gh-105440\r\n* gh-105441\r\n* gh-105475\r\n* gh-105491\r\n* gh-105494\r\n* gh-105581\r\n* gh-105582\r\n* gh-105583\r\n* gh-105584\r\n* gh-105585\r\n* gh-105586\r\n* gh-105590\r\n* gh-105591\r\n* gh-105592\r\n* gh-105593\r\n* gh-105594\r\n* gh-105596\r\n* gh-105597\r\n* gh-105598\r\n* gh-105599\r\n* gh-105600\r\n* gh-105601\r\n* gh-105604\r\n* gh-105605\r\n* gh-105608\r\n* gh-105610\r\n* gh-105611\r\n* gh-105612\r\n* gh-105613\r\n* gh-105615\r\n* gh-105642\r\n* gh-105643\r\n* gh-105644\r\n* gh-105645\r\n* gh-105646\r\n* gh-105647\r\n* gh-105648\r\n* gh-105649\r\n* gh-105650\r\n* gh-105651\r\n* gh-105659\r\n* gh-105660\r\n* gh-105661\r\n* gh-105662\r\n* gh-105663\r\n* gh-105664\r\n* gh-105665\r\n* gh-105666\r\n* gh-105667\r\n* gh-105668\n* gh-105669\n* gh-105686\n* gh-105710\n* gh-105711\n* gh-105720\n* gh-105721\n\u003c!-- /gh-linked-prs --\u003e\r\n","author":{"url":"https://github.com/erlend-aasland","@type":"Person","name":"erlend-aasland"},"datePublished":"2023-06-06T13:31:33.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":9},"url":"https://github.com/105375/cpython/issues/105375"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:800385fe-6c74-161f-33cb-be2b665bcc49
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id9164:1B1D69:192AD33:22B04E8:696AA40D
html-safe-nonce814c94dbe238e558711309d7a9e35261d5aa349b68e410fdc9bc401212518361
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5MTY0OjFCMUQ2OToxOTJBRDMzOjIyQjA0RTg6Njk2QUE0MEQiLCJ2aXNpdG9yX2lkIjoiNTM1OTI0MjQ5NDE1NzE2OTY3NyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac31bbe4642f7a9e2d82b8d933fa2d69f75a565c0938f5799c8e9ecc328b84dade
hovercard-subject-tagissue:1743883856
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/105375/issue_layout
twitter:imagehttps://opengraph.githubassets.com/e28d160c19cdd0f14bb74df40353a31239d9b4f6690cacd47fed369bbe642011/python/cpython/issues/105375
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/e28d160c19cdd0f14bb74df40353a31239d9b4f6690cacd47fed369bbe642011/python/cpython/issues/105375
og:image:altFor example, in the collation callback two str objects (string1 and string2) are created using PyUnicode_FromStringAndSize. Error handling should happen directly after each call to PyUnicode_FromSt...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameerlend-aasland
hostnamegithub.com
expected-hostnamegithub.com
Nonea51f97dbb9326f71c08ecb61577457d543c602124d1a2672871258ef37ac5261
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
release4bd0eac606c70914085176ef312ebdcd97a8cdf1
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/python/cpython/issues/105375#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fissues%2F105375
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%2Fissues%2F105375
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%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=python%2Fcpython
Reloadhttps://github.com/python/cpython/issues/105375
Reloadhttps://github.com/python/cpython/issues/105375
Reloadhttps://github.com/python/cpython/issues/105375
python https://github.com/python
cpythonhttps://github.com/python/cpython
Please reload this pagehttps://github.com/python/cpython/issues/105375
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/issues/105375
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
New issuehttps://github.com/login?return_to=https://github.com/python/cpython/issues/105375
New issuehttps://github.com/login?return_to=https://github.com/python/cpython/issues/105375
Incorrect error handling for APIs that can raise exceptionshttps://github.com/python/cpython/issues/105375#top
#105610https://github.com/python/cpython/pull/105610
https://github.com/erlend-aasland
3.11only security fixeshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%223.11%22
3.12only security fixeshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%223.12%22
3.13bugs and security fixeshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%223.13%22
topic-C-APIhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22topic-C-API%22
type-bugAn unexpected behavior, bug, or errorhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-bug%22
https://github.com/erlend-aasland
https://github.com/erlend-aasland
erlend-aaslandhttps://github.com/erlend-aasland
on Jun 6, 2023https://github.com/python/cpython/issues/105375#issue-1743883856
cpython/Modules/_sqlite/connection.chttps://github.com/python/cpython/blob/0cb6b9b0db5df6b3f902e86eb3d4a1e504afb851/Modules/_sqlite/connection.c#L1870-L1875
0cb6b9bhttps://github.com/python/cpython/commit/0cb6b9b0db5df6b3f902e86eb3d4a1e504afb851
gh-105375: Improve error handling in PyUnicode_BuildEncodingMap() #105491https://github.com/python/cpython/pull/105491
gh-105375: Improve error handling in compiler_enter_scope() #105494https://github.com/python/cpython/pull/105494
gh-105375: Improve error handling in the builtins extension module #105585https://github.com/python/cpython/pull/105585
gh-105375: Improve errnomodule error handling #105590https://github.com/python/cpython/pull/105590
gh-105375: Improve error handling in _elementtree #105591https://github.com/python/cpython/pull/105591
gh-105375: Improve posix error handling #105592https://github.com/python/cpython/pull/105592
gh-105375: Improve error handling in _ctypes #105593https://github.com/python/cpython/pull/105593
gh-105375: Improve array.array exception handling #105594https://github.com/python/cpython/pull/105594
gh-105375: Improve error handling in _Unpickler_SetInputStream() #105667https://github.com/python/cpython/pull/105667
gh-105375: Improve _pickle error handling #105475https://github.com/python/cpython/pull/105475
gh-105375: Harden _ssl initialisation #105599https://github.com/python/cpython/pull/105599
gh-105375: Improve error handling in zoneinfo module #105586https://github.com/python/cpython/pull/105586
gh-105375: Harden _datetime initialisation #105604https://github.com/python/cpython/pull/105604
gh-105375: Harden pyexpat initialisation #105606https://github.com/python/cpython/pull/105606
gh-105375: Improve _decimal error handling #105605https://github.com/python/cpython/pull/105605
gh-105375: Harden error handling in _testcapi/heaptype.c #105608https://github.com/python/cpython/pull/105608
gh-105375: Improve PyErr_WarnExplicit() error handling #105610https://github.com/python/cpython/pull/105610
gh-105375: Improve error handling in the sys extension module #105611https://github.com/python/cpython/pull/105611
gh-105375: Improve error handling in sqlite3 collation callback #105412https://github.com/python/cpython/pull/105412
[3.12] gh-105375: Improve error handling in sqlite3 collation callback (GH-105412) #105440https://github.com/python/cpython/pull/105440
[3.11] gh-105375: Improve error handling in sqlite3 collation callback (GH-105412) #105441https://github.com/python/cpython/pull/105441
gh-105375: Improve _pickle error handling #105475https://github.com/python/cpython/pull/105475
gh-105375: Improve error handling in PyUnicode_BuildEncodingMap() #105491https://github.com/python/cpython/pull/105491
gh-105375: Improve error handling in compiler_enter_scope() #105494https://github.com/python/cpython/pull/105494
[3.12] gh-105375: Improve error handling in compiler_enter_scope() (GH-105494) #105581https://github.com/python/cpython/pull/105581
[3.11] gh-105375: Improve error handling in compiler_enter_scope() (#105494) #105582https://github.com/python/cpython/pull/105582
[3.11] gh-105375: Improve _pickle error handling (#105475) #105583https://github.com/python/cpython/pull/105583
[3.12] gh-105375: Improve _pickle error handling (#105475) #105584https://github.com/python/cpython/pull/105584
gh-105375: Improve error handling in the builtins extension module #105585https://github.com/python/cpython/pull/105585
gh-105375: Improve error handling in zoneinfo module #105586https://github.com/python/cpython/pull/105586
gh-105375: Improve errnomodule error handling #105590https://github.com/python/cpython/pull/105590
gh-105375: Improve error handling in _elementtree #105591https://github.com/python/cpython/pull/105591
gh-105375: Improve posix error handling #105592https://github.com/python/cpython/pull/105592
gh-105375: Improve error handling in _ctypes #105593https://github.com/python/cpython/pull/105593
gh-105375: Improve array.array exception handling #105594https://github.com/python/cpython/pull/105594
[3.12] gh-105375: Improve errnomodule error handling (#105590) #105596https://github.com/python/cpython/pull/105596
[3.11] gh-105375: Improve posix error handling (GH-105592) #105597https://github.com/python/cpython/pull/105597
[3.12] gh-105375: Improve posix error handling (GH-105592) #105598https://github.com/python/cpython/pull/105598
gh-105375: Harden _ssl initialisation #105599https://github.com/python/cpython/pull/105599
[3.12] gh-105375: Improve error handling in _elementtree (GH-105591) #105600https://github.com/python/cpython/pull/105600
[3.11] gh-105375: Improve error handling in _elementtree (GH-105591) #105601https://github.com/python/cpython/pull/105601
gh-105375: Harden _datetime initialisation #105604https://github.com/python/cpython/pull/105604
gh-105375: Improve _decimal error handling #105605https://github.com/python/cpython/pull/105605
gh-105375: Harden error handling in _testcapi/heaptype.c #105608https://github.com/python/cpython/pull/105608
gh-105375: Improve PyErr_WarnExplicit() error handling #105610https://github.com/python/cpython/pull/105610
gh-105375: Improve error handling in the sys extension module #105611https://github.com/python/cpython/pull/105611
[3.12] gh-105375: Improve error handling in zoneinfo module (GH-105586) #105612https://github.com/python/cpython/pull/105612
[3.11] gh-105375: Improve error handling in zoneinfo module (GH-105586) #105613https://github.com/python/cpython/pull/105613
[3.12] gh-105375: Harden error handling in _testcapi/heaptype.c (GH-105608) #105615https://github.com/python/cpython/pull/105615
[3.12] gh-105375: Harden _ssl initialisation (GH-105599) #105642https://github.com/python/cpython/pull/105642
[3.11] gh-105375: Improve array.array exception handling (GH-105594) #105643https://github.com/python/cpython/pull/105643
[3.12] gh-105375: Improve array.array exception handling (GH-105594) #105644https://github.com/python/cpython/pull/105644
[3.12] gh-105375: Harden _datetime initialisation (GH-105604) #105645https://github.com/python/cpython/pull/105645
[3.11] gh-105375: Harden _datetime initialisation (GH-105604) #105646https://github.com/python/cpython/pull/105646
[3.12] gh-105375: Improve _decimal error handling (GH-105605) #105647https://github.com/python/cpython/pull/105647
[3.11] gh-105375: Improve _decimal error handling (GH-105605) #105648https://github.com/python/cpython/pull/105648
[3.12] gh-105375: Improve error handling in the builtins extension module (GH-105585) #105649https://github.com/python/cpython/pull/105649
[3.11] gh-105375: Improve error handling in the builtins extension module (GH-105585) #105650https://github.com/python/cpython/pull/105650
[3.11] gh-105375: Harden _ssl initialisation (#105599) #105651https://github.com/python/cpython/pull/105651
[3.12] gh-105375: Improve PyErr_WarnExplicit() error handling (GH-105610) #105659https://github.com/python/cpython/pull/105659
[3.11] gh-105375: Improve PyErr_WarnExplicit() error handling (GH-105610) #105660https://github.com/python/cpython/pull/105660
[3.12] gh-105375: Improve error handling in PyUnicode_BuildEncodingMap() (GH-105491) #105661https://github.com/python/cpython/pull/105661
[3.11] gh-105375: Improve error handling in PyUnicode_BuildEncodingMap() (GH-105491) #105662https://github.com/python/cpython/pull/105662
[3.12] gh-105375: Improve error handling in _ctypes (GH-105593) #105663https://github.com/python/cpython/pull/105663
[3.11] gh-105375: Improve error handling in _ctypes (GH-105593) #105664https://github.com/python/cpython/pull/105664
[3.12] gh-105375: Improve error handling in the sys extension module (GH-105611) #105665https://github.com/python/cpython/pull/105665
[3.11] gh-105375: Improve error handling in the sys extension module (#105611) #105666https://github.com/python/cpython/pull/105666
gh-105375: Improve error handling in _Unpickler_SetInputStream() #105667https://github.com/python/cpython/pull/105667
[3.11] gh-105375: Harden pyexpat initialisation (#105606) #105668https://github.com/python/cpython/pull/105668
[3.12] gh-105375: Harden pyexpat initialisation (#105606) #105669https://github.com/python/cpython/pull/105669
gh-105375: Explicitly initialise all {Pickler,Unpickler}Object fields #105686https://github.com/python/cpython/pull/105686
[3.12] gh-105375: Explicitly initialise all {Pickler,Unpickler}Object fields (GH-105686) #105710https://github.com/python/cpython/pull/105710
[3.11] gh-105375: Explicitly initialise all {Pickler,Unpickler}Object fields (#105686) #105711https://github.com/python/cpython/pull/105711
[3.12] gh-105375: Improve error handling in _Unpickler_SetInputStream() (#105667) #105720https://github.com/python/cpython/pull/105720
[3.11] gh-105375: Improve error handling in _Unpickler_SetInputStream() (#105667) #105721https://github.com/python/cpython/pull/105721
erlend-aaslandhttps://github.com/erlend-aasland
3.11only security fixeshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%223.11%22
3.12only security fixeshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%223.12%22
3.13bugs and security fixeshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%223.13%22
topic-C-APIhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22topic-C-API%22
type-bugAn unexpected behavior, bug, or errorhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-bug%22
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.