René's URL Explorer Experiment


Title: gh-157242: Fix PyBytesWriter_Resize() on MemoryError by vstinner · Pull Request #157243 · python/cpython · GitHub

Open Graph Title: gh-157242: Fix PyBytesWriter_Resize() on MemoryError by vstinner · Pull Request #157243 · python/cpython

X Title: gh-157242: Fix PyBytesWriter_Resize() on MemoryError by vstinner · Pull Request #157243 · python/cpython

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

Open Graph Description: If PyBytesWriter_Resize() fails, leave the writer unchanged. Add a new internal _PyBytes_ResizeKeepOnError() function similar to _PyBytes_Resize() but leaves the bytes object unchanged on error. ...

X Description: If PyBytesWriter_Resize() fails, leave the writer unchanged. Add a new internal _PyBytes_ResizeKeepOnError() function similar to _PyBytes_Resize() but leaves the bytes object unchanged on error. ...

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

X: @github

direct link

Domain: github.com

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/:user_id/:repository/pull/:id/commits(.:format)
route-controllerpull_requests
route-actioncommits
fetch-noncev2:463dc8ad-16ac-921b-7a0a-6bff498549bd
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-id9CD0:7A60E:3795B93:47511E5:6B01EE32
html-safe-nonce7532331ddb22e1e29fa883196e680ca3ebbc1b49951c795ee7a33ec905a994ed
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5Q0QwOjdBNjBFOjM3OTVCOTM6NDc1MTFFNTo2QjAxRUUzMiIsInZpc2l0b3JfaWQiOiIzOTU0OTEwNTczNDg0OTYxMzMwIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac722b66103206a9461efb9fcaeb656d268e1d6287c56e1cb497c7e18eb8a74250
hovercard-subject-tagpull_request:4490707277
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/157243/commits
twitter:imagehttps://opengraph.githubassets.com/1fa59db537d87a5ce0cdf6f2b7234018e6f26900f745c3cd45247b0853bbef2a/python/cpython/pull/157243
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/1fa59db537d87a5ce0cdf6f2b7234018e6f26900f745c3cd45247b0853bbef2a/python/cpython/pull/157243
og:image:altIf PyBytesWriter_Resize() fails, leave the writer unchanged. Add a new internal _PyBytes_ResizeKeepOnError() function similar to _PyBytes_Resize() but leaves the bytes object unchanged on error. ...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamevstinner
hostnamegithub.com
expected-hostnamegithub.com
None87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456
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
release423dbb54c5e7bfecc838eb387c1435eb3d0e760d
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-namepull-requests

Links:

Skip to contenthttps://github.com/python/cpython/pull/157243/commits#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F157243%2Fcommits
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
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
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://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
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F157243%2Fcommits
Sign uphttps://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/157243/commits
Reloadhttps://github.com/python/cpython/pull/157243/commits
Reloadhttps://github.com/python/cpython/pull/157243/commits
pythonhttps://github.com/python
cpythonhttps://github.com/python/cpython
Codehttps://github.com/python/cpython
Issues5k+ (5k+)https://github.com/python/cpython/issues
Pull requests2.4k (2.4k)https://github.com/python/cpython/pulls
Actionshttps://github.com/python/cpython/actions
Projectshttps://github.com/python/cpython/projects
Security and qualityhttps://github.com/python/cpython/security
Insightshttps://github.com/python/cpython/insights
https://github.com/python/cpython
vstinnerhttps://github.com/vstinner
python:mainhttps://github.com/python/cpython/tree/main
vstinner:writer_resize2https://github.com/vstinner/cpython/tree/writer_resize2
Conversationhttps://github.com/python/cpython/pull/157243
Commits23 (23)https://github.com/python/cpython/pull/157243/commits
Checkshttps://github.com/python/cpython/pull/157243/checks
Files changedhttps://github.com/python/cpython/pull/157243/files
gh-157242: Fix PyBytesWriter_Resize() on MemoryErrorhttps://github.com/python/cpython/pull/157243/commits#top
vstinnerhttps://github.com/vstinner
python:mainhttps://github.com/python/cpython/tree/main
vstinner:writer_resize2https://github.com/vstinner/cpython/tree/writer_resize2
gh-157242: Leave bytearray unchanged if resize() failshttps://github.com/python/cpython/pull/157243/commits/d0441c49597936730fc9ba6c69bba5e6814399a8
https://github.com/vstinner
vstinnerhttps://github.com/python/cpython/commits?author=vstinner
d0441c4https://github.com/python/cpython/pull/157243/commits/d0441c49597936730fc9ba6c69bba5e6814399a8
https://github.com/python/cpython/tree/d0441c49597936730fc9ba6c69bba5e6814399a8
Add NEWS entrieshttps://github.com/python/cpython/pull/157243/commits/5f1ef328da91e6708fd4c474508a32408d069a19
https://github.com/vstinner
vstinnerhttps://github.com/python/cpython/commits?author=vstinner
5f1ef32https://github.com/python/cpython/pull/157243/commits/5f1ef328da91e6708fd4c474508a32408d069a19
https://github.com/python/cpython/tree/5f1ef328da91e6708fd4c474508a32408d069a19
Fix resize() with non-zero starthttps://github.com/python/cpython/pull/157243/commits/a1e64d39f51d65e9572c94604e16d5b001ed4caa
vstinnerhttps://github.com/python/cpython/commits?author=vstinner
maurycyhttps://github.com/python/cpython/commits?author=maurycy
a1e64d3https://github.com/python/cpython/pull/157243/commits/a1e64d39f51d65e9572c94604e16d5b001ed4caa
https://github.com/python/cpython/tree/a1e64d39f51d65e9572c94604e16d5b001ed4caa
Reimplement _PyBytes_Resize() via _PyBytes_ResizeKeepOnError()https://github.com/python/cpython/pull/157243/commits/4b4bcfba9682cd70076ad848497fca001a4f2988
https://github.com/vstinner
vstinnerhttps://github.com/python/cpython/commits?author=vstinner
4b4bcfbhttps://github.com/python/cpython/pull/157243/commits/4b4bcfba9682cd70076ad848497fca001a4f2988
https://github.com/python/cpython/tree/4b4bcfba9682cd70076ad848497fca001a4f2988
Merge branch 'main' into writer_resize2https://github.com/python/cpython/pull/157243/commits/ba27fe049c0cf53eb8243b86a9639865f4214eb3
https://github.com/vstinner
vstinnerhttps://github.com/python/cpython/commits?author=vstinner
ba27fe0https://github.com/python/cpython/pull/157243/commits/ba27fe049c0cf53eb8243b86a9639865f4214eb3
https://github.com/python/cpython/tree/ba27fe049c0cf53eb8243b86a9639865f4214eb3
Fix resize() when shrinking the bytearrayhttps://github.com/python/cpython/pull/157243/commits/4d581fae561124a745c27fbadbe4f54751cf7199
https://github.com/vstinner
vstinnerhttps://github.com/python/cpython/commits?author=vstinner
4d581fahttps://github.com/python/cpython/pull/157243/commits/4d581fae561124a745c27fbadbe4f54751cf7199
https://github.com/python/cpython/tree/4d581fae561124a745c27fbadbe4f54751cf7199
Fix take_bytes()https://github.com/python/cpython/pull/157243/commits/f51cba57d3e5b2acb6bfd4540ebf4abc679beb71
https://github.com/vstinner
vstinnerhttps://github.com/python/cpython/commits?author=vstinner
f51cba5https://github.com/python/cpython/pull/157243/commits/f51cba57d3e5b2acb6bfd4540ebf4abc679beb71
https://github.com/python/cpython/tree/f51cba57d3e5b2acb6bfd4540ebf4abc679beb71
Fix typo in test_take_bytes_error(): pass to_take argumenthttps://github.com/python/cpython/pull/157243/commits/7116757d42fd0e3c744b899b9195bfbc7a6ff06e
https://github.com/vstinner
vstinnerhttps://github.com/python/cpython/commits?author=vstinner
7116757https://github.com/python/cpython/pull/157243/commits/7116757d42fd0e3c744b899b9195bfbc7a6ff06e
https://github.com/python/cpython/tree/7116757d42fd0e3c744b899b9195bfbc7a6ff06e
Add inject_memory_error()https://github.com/python/cpython/pull/157243/commits/0ca5c9cd8b670d46d236e2174b9a7e4b5e8e5934
https://github.com/vstinner
vstinnerhttps://github.com/python/cpython/commits?author=vstinner
0ca5c9chttps://github.com/python/cpython/pull/157243/commits/0ca5c9cd8b670d46d236e2174b9a7e4b5e8e5934
https://github.com/python/cpython/tree/0ca5c9cd8b670d46d236e2174b9a7e4b5e8e5934
Remove alloc parameter of bytearray_reinit_from_bytes()https://github.com/python/cpython/pull/157243/commits/ba1e2c8d6be990393f83492891ec14500c7ab56b
https://github.com/vstinner
vstinnerhttps://github.com/python/cpython/commits?author=vstinner
ba1e2c8https://github.com/python/cpython/pull/157243/commits/ba1e2c8d6be990393f83492891ec14500c7ab56b
https://github.com/python/cpython/tree/ba1e2c8d6be990393f83492891ec14500c7ab56b
Add bytearray_realign_data_lock_held()https://github.com/python/cpython/pull/157243/commits/e9e1f02cd8bff76b30ea54bff4587bae5a7a3bf9
https://github.com/vstinner
vstinnerhttps://github.com/python/cpython/commits?author=vstinner
e9e1f02https://github.com/python/cpython/pull/157243/commits/e9e1f02cd8bff76b30ea54bff4587bae5a7a3bf9
https://github.com/python/cpython/tree/e9e1f02cd8bff76b30ea54bff4587bae5a7a3bf9
Don't call _PyReftracerTrack() on dangling pointerhttps://github.com/python/cpython/pull/157243/commits/a0a3753ce6338a45db3f48af5af33f4ddb963d22
https://github.com/vstinner
vstinnerhttps://github.com/python/cpython/commits?author=vstinner
a0a3753https://github.com/python/cpython/pull/157243/commits/a0a3753ce6338a45db3f48af5af33f4ddb963d22
https://github.com/python/cpython/tree/a0a3753ce6338a45db3f48af5af33f4ddb963d22
Add test_bytes_resize_tracer()https://github.com/python/cpython/pull/157243/commits/53c3b5117971c3b85e658dc5706b6362be547435
https://github.com/vstinner
vstinnerhttps://github.com/python/cpython/commits?author=vstinner
53c3b51https://github.com/python/cpython/pull/157243/commits/53c3b5117971c3b85e658dc5706b6362be547435
https://github.com/python/cpython/tree/53c3b5117971c3b85e658dc5706b6362be547435
Write trailing null bytes on MemoryErrorhttps://github.com/python/cpython/pull/157243/commits/fb67d23ef0e22e8c91c1bde28aecb737985a7feb
https://github.com/vstinner
vstinnerhttps://github.com/python/cpython/commits?author=vstinner
fb67d23https://github.com/python/cpython/pull/157243/commits/fb67d23ef0e22e8c91c1bde28aecb737985a7feb
https://github.com/python/cpython/tree/fb67d23ef0e22e8c91c1bde28aecb737985a7feb
Add bytearray_write_trailing_null_byte()https://github.com/python/cpython/pull/157243/commits/6762d16bec021983889af2b1608bfc6d135948c8
https://github.com/vstinner
vstinnerhttps://github.com/python/cpython/commits?author=vstinner
6762d16https://github.com/python/cpython/pull/157243/commits/6762d16bec021983889af2b1608bfc6d135948c8
https://github.com/python/cpython/tree/6762d16bec021983889af2b1608bfc6d135948c8
Optimize bytearray_realign_data_lock_held()https://github.com/python/cpython/pull/157243/commits/909270cc3d87777cac6bc021cc365ae2b7b4609b
https://github.com/vstinner
vstinnerhttps://github.com/python/cpython/commits?author=vstinner
909270chttps://github.com/python/cpython/pull/157243/commits/909270cc3d87777cac6bc021cc365ae2b7b4609b
https://github.com/python/cpython/tree/909270cc3d87777cac6bc021cc365ae2b7b4609b
Fix bytearray_resize_storage()https://github.com/python/cpython/pull/157243/commits/0a33fd4ef0a88bb42acd460df98feb7979304f95
https://github.com/vstinner
vstinnerhttps://github.com/python/cpython/commits?author=vstinner
0a33fd4https://github.com/python/cpython/pull/157243/commits/0a33fd4ef0a88bb42acd460df98feb7979304f95
https://github.com/python/cpython/tree/0a33fd4ef0a88bb42acd460df98feb7979304f95
Add one more take_bytes() error testhttps://github.com/python/cpython/pull/157243/commits/dfb05bfc4f863803d07833d5caaba417f5d016e2
https://github.com/vstinner
vstinnerhttps://github.com/python/cpython/commits?author=vstinner
dfb05bfhttps://github.com/python/cpython/pull/157243/commits/dfb05bfc4f863803d07833d5caaba417f5d016e2
https://github.com/python/cpython/tree/dfb05bfc4f863803d07833d5caaba417f5d016e2
no need for testing PyBytesWriter_Resize() shrinkinghttps://github.com/python/cpython/pull/157243/commits/2f1e9652d8a7cd10ec153d4f684bee2f8db116d1
https://github.com/vstinner
vstinnerhttps://github.com/python/cpython/commits?author=vstinner
2f1e965https://github.com/python/cpython/pull/157243/commits/2f1e9652d8a7cd10ec153d4f684bee2f8db116d1
https://github.com/python/cpython/tree/2f1e9652d8a7cd10ec153d4f684bee2f8db116d1
Merge branch 'main' into writer_resize2https://github.com/python/cpython/pull/157243/commits/306f13270b0d80b884545c89114ed5c768384a58
https://github.com/vstinner
vstinnerhttps://github.com/python/cpython/commits?author=vstinner
306f132https://github.com/python/cpython/pull/157243/commits/306f13270b0d80b884545c89114ed5c768384a58
https://github.com/python/cpython/tree/306f13270b0d80b884545c89114ed5c768384a58
Revert bytearray changeshttps://github.com/python/cpython/pull/157243/commits/a9a1423a1293c67dc9e7b6e24f908e2b98cce0c9
https://github.com/vstinner
vstinnerhttps://github.com/python/cpython/commits?author=vstinner
a9a1423https://github.com/python/cpython/pull/157243/commits/a9a1423a1293c67dc9e7b6e24f908e2b98cce0c9
https://github.com/python/cpython/tree/a9a1423a1293c67dc9e7b6e24f908e2b98cce0c9
Resize: set pv earlierhttps://github.com/python/cpython/pull/157243/commits/9fa1305a1b4b30ab7cf9e89d1a024e60084d01c4
https://github.com/vstinner
vstinnerhttps://github.com/python/cpython/commits?author=vstinner
9fa1305https://github.com/python/cpython/pull/157243/commits/9fa1305a1b4b30ab7cf9e89d1a024e60084d01c4
https://github.com/python/cpython/tree/9fa1305a1b4b30ab7cf9e89d1a024e60084d01c4
Move PyBytesWriter testhttps://github.com/python/cpython/pull/157243/commits/9ce6a9946df6823c12f73d4f2d0a24dd040bb229
https://github.com/vstinner
vstinnerhttps://github.com/python/cpython/commits?author=vstinner
9ce6a99https://github.com/python/cpython/pull/157243/commits/9ce6a9946df6823c12f73d4f2d0a24dd040bb229
https://github.com/python/cpython/tree/9ce6a9946df6823c12f73d4f2d0a24dd040bb229
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.