René's URL Explorer Experiment


Title: [3.15] gh-159739: Preserve CJK codec state across chunk boundaries and callbacks (GH-160400) by gpshead · Pull Request #161069 · python/cpython · GitHub

Open Graph Title: [3.15] gh-159739: Preserve CJK codec state across chunk boundaries and callbacks (GH-160400) by gpshead · Pull Request #161069 · python/cpython

X Title: [3.15] gh-159739: Preserve CJK codec state across chunk boundaries and callbacks (GH-160400) by gpshead · Pull Request #161069 · python/cpython

Description: The HZ encoder can consume a tilde after writing only its first escape byte. A split ISO-2022 escape can exceed the incremental decoder’s pending buffer, and a reset can leave the previous character set selected. Reserve space for both HZ bytes before consuming the tilde, allow the full pending escape, and restore the initial ISO-2022 state on reset. Keep the native codec table and the active encoder error policy alive so replacing their Python owners cannot leave a codec using freed memory. (cherry picked from commit a96fbdc) Manual backport notes (3.15): the automated backport conflicted in multibytecodec_encode() because 3.15 predates the PyBytesWriter conversion (gh-155742). The ERROR_DECREF(errors) calls are added to the existing buf.outobj return and error paths instead; nothing else differs. test_multibytecodec and the CJK codec tests pass with -R 3:3. This is needed before the gh-160185 backport (GH-161067), whose new tests rely on the ISO-2022 reset fix here. Issue: gh-159739

Open Graph Description: The HZ encoder can consume a tilde after writing only its first escape byte. A split ISO-2022 escape can exceed the incremental decoder’s pending buffer, and a reset can leave the previous characte...

X Description: The HZ encoder can consume a tilde after writing only its first escape byte. A split ISO-2022 escape can exceed the incremental decoder’s pending buffer, and a reset can leave the previous characte...

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

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/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:7967ec72-40a8-dbd7-0dc9-5303fc64f064
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idE0DE:299992:1EACD47:285F314:6B022F44
html-safe-nonce6eef9084c94ba278fba7a029de3ef76e6564fe1bbd8d6c956fc80721c67a3e46
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMERFOjI5OTk5MjoxRUFDRDQ3OjI4NUYzMTQ6NkIwMjJGNDQiLCJ2aXNpdG9yX2lkIjoiNjM2OTg1ODE0NzI5MjY4ODE5NiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmacf213078c38ed583a3abfa11831da830b89c992afe01cde504aea3328485e7a01
hovercard-subject-tagpull_request:5105221721
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/161069/files
twitter:imagehttps://avatars.githubusercontent.com/u/68491?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/68491?s=400&v=4
og:image:altThe HZ encoder can consume a tilde after writing only its first escape byte. A split ISO-2022 escape can exceed the incremental decoder’s pending buffer, and a reset can leave the previous characte...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456
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
release423dbb54c5e7bfecc838eb387c1435eb3d0e760d
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/python/cpython/pull/161069/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F161069%2Ffiles
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%2F161069%2Ffiles
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%2Ffiles&source=header-repo&source_repo=python%2Fcpython
Reloadhttps://github.com/python/cpython/pull/161069/files
Reloadhttps://github.com/python/cpython/pull/161069/files
Reloadhttps://github.com/python/cpython/pull/161069/files
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
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
gpsheadhttps://github.com/gpshead
python:3.15https://github.com/python/cpython/tree/3.15
gpshead:backport-a96fbdc-3.15https://github.com/gpshead/cpython/tree/backport-a96fbdc-3.15
Conversation 0 https://github.com/python/cpython/pull/161069
Commits 1 https://github.com/python/cpython/pull/161069/commits
Checks 56 https://github.com/python/cpython/pull/161069/checks
Files changed https://github.com/python/cpython/pull/161069/files
Please reload this pagehttps://github.com/python/cpython/pull/161069/files
[3.15] gh-159739: Preserve CJK codec state across chunk boundaries and callbacks (GH-160400) https://github.com/python/cpython/pull/161069/files#top
Show all changes 1 commit https://github.com/python/cpython/pull/161069/files
be35cbe [3.15] gh-159739: Preserve CJK codec state across chunk boundaries an… jelle-openai Oct 23, 2026 https://github.com/python/cpython/pull/161069/commits/be35cbe3ce2de98c6acca6999a49693c17428753
Clear filters https://github.com/python/cpython/pull/161069/files
Please reload this pagehttps://github.com/python/cpython/pull/161069/files
Please reload this pagehttps://github.com/python/cpython/pull/161069/files
test_multibytecodec.py https://github.com/python/cpython/pull/161069/files#diff-dd581d0e13d6428fa0fab82580799c388e2e4fcfe634fcf8001221d492cfd7df
2026-10-22-16-23-01.gh-issue-159739.CjkR5a.rst https://github.com/python/cpython/pull/161069/files#diff-72f7453d299f3c13ea358daf4ebc35a1d02b1af9793037058ae3433db269bc29
_codecs_cn.c https://github.com/python/cpython/pull/161069/files#diff-3ef8c952d550468e8bbbfa519cef95ea3d314e5a8b2993d257e61cf7c42b7bd5
_codecs_iso2022.c https://github.com/python/cpython/pull/161069/files#diff-79ee76394f07ac23803654a41d05aa77a7f33c79d45a9c3617bc916c1d592427
multibytecodec.c https://github.com/python/cpython/pull/161069/files#diff-bc8499ed0d5bebcd8e193fed4430a5d4ac73fa49ce155cf2e6937faf39911d4f
multibytecodec.h https://github.com/python/cpython/pull/161069/files#diff-23d48615b15bc60579de4ec68b088b6a59fdb8ae6156d6bf2d7ca969b013786d
Lib/test/test_multibytecodec.pyhttps://github.com/python/cpython/pull/161069/files#diff-dd581d0e13d6428fa0fab82580799c388e2e4fcfe634fcf8001221d492cfd7df
View file https://github.com/gpshead/cpython/blob/be35cbe3ce2de98c6acca6999a49693c17428753/Lib/test/test_multibytecodec.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/161069/{{ revealButtonHref }}
https://github.com/python/cpython/pull/161069/files#diff-dd581d0e13d6428fa0fab82580799c388e2e4fcfe634fcf8001221d492cfd7df
https://github.com/python/cpython/pull/161069/files#diff-dd581d0e13d6428fa0fab82580799c388e2e4fcfe634fcf8001221d492cfd7df
https://github.com/python/cpython/pull/161069/files#diff-dd581d0e13d6428fa0fab82580799c388e2e4fcfe634fcf8001221d492cfd7df
https://github.com/python/cpython/pull/161069/files#diff-dd581d0e13d6428fa0fab82580799c388e2e4fcfe634fcf8001221d492cfd7df
https://github.com/python/cpython/pull/161069/files#diff-dd581d0e13d6428fa0fab82580799c388e2e4fcfe634fcf8001221d492cfd7df
https://github.com/python/cpython/pull/161069/files#diff-dd581d0e13d6428fa0fab82580799c388e2e4fcfe634fcf8001221d492cfd7df
https://github.com/python/cpython/pull/161069/files#diff-dd581d0e13d6428fa0fab82580799c388e2e4fcfe634fcf8001221d492cfd7df
https://github.com/python/cpython/pull/161069/files#diff-dd581d0e13d6428fa0fab82580799c388e2e4fcfe634fcf8001221d492cfd7df
Misc/NEWS.d/next/Library/2026-10-22-16-23-01.gh-issue-159739.CjkR5a.rsthttps://github.com/python/cpython/pull/161069/files#diff-72f7453d299f3c13ea358daf4ebc35a1d02b1af9793037058ae3433db269bc29
View file https://github.com/gpshead/cpython/blob/be35cbe3ce2de98c6acca6999a49693c17428753/Misc/NEWS.d/next/Library/2026-10-22-16-23-01.gh-issue-159739.CjkR5a.rst
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/161069/{{ revealButtonHref }}
https://github.com/python/cpython/blob/3.15/.github/CODEOWNERS#L398
Modules/cjkcodecs/_codecs_cn.chttps://github.com/python/cpython/pull/161069/files#diff-3ef8c952d550468e8bbbfa519cef95ea3d314e5a8b2993d257e61cf7c42b7bd5
View file https://github.com/gpshead/cpython/blob/be35cbe3ce2de98c6acca6999a49693c17428753/Modules/cjkcodecs/_codecs_cn.c
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/161069/{{ revealButtonHref }}
https://github.com/python/cpython/pull/161069/files#diff-3ef8c952d550468e8bbbfa519cef95ea3d314e5a8b2993d257e61cf7c42b7bd5
https://github.com/python/cpython/pull/161069/files#diff-3ef8c952d550468e8bbbfa519cef95ea3d314e5a8b2993d257e61cf7c42b7bd5
https://github.com/python/cpython/blob/3.15/.github/CODEOWNERS#L398
Modules/cjkcodecs/_codecs_iso2022.chttps://github.com/python/cpython/pull/161069/files#diff-79ee76394f07ac23803654a41d05aa77a7f33c79d45a9c3617bc916c1d592427
View file https://github.com/gpshead/cpython/blob/be35cbe3ce2de98c6acca6999a49693c17428753/Modules/cjkcodecs/_codecs_iso2022.c
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/161069/{{ revealButtonHref }}
https://github.com/python/cpython/pull/161069/files#diff-79ee76394f07ac23803654a41d05aa77a7f33c79d45a9c3617bc916c1d592427
https://github.com/python/cpython/pull/161069/files#diff-79ee76394f07ac23803654a41d05aa77a7f33c79d45a9c3617bc916c1d592427
https://github.com/python/cpython/pull/161069/files#diff-79ee76394f07ac23803654a41d05aa77a7f33c79d45a9c3617bc916c1d592427
https://github.com/python/cpython/pull/161069/files#diff-79ee76394f07ac23803654a41d05aa77a7f33c79d45a9c3617bc916c1d592427
https://github.com/python/cpython/blob/3.15/.github/CODEOWNERS#L398
Modules/cjkcodecs/multibytecodec.chttps://github.com/python/cpython/pull/161069/files#diff-bc8499ed0d5bebcd8e193fed4430a5d4ac73fa49ce155cf2e6937faf39911d4f
View file https://github.com/gpshead/cpython/blob/be35cbe3ce2de98c6acca6999a49693c17428753/Modules/cjkcodecs/multibytecodec.c
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/161069/{{ revealButtonHref }}
https://github.com/python/cpython/pull/161069/files#diff-bc8499ed0d5bebcd8e193fed4430a5d4ac73fa49ce155cf2e6937faf39911d4f
https://github.com/python/cpython/pull/161069/files#diff-bc8499ed0d5bebcd8e193fed4430a5d4ac73fa49ce155cf2e6937faf39911d4f
https://github.com/python/cpython/pull/161069/files#diff-bc8499ed0d5bebcd8e193fed4430a5d4ac73fa49ce155cf2e6937faf39911d4f
https://github.com/python/cpython/pull/161069/files#diff-bc8499ed0d5bebcd8e193fed4430a5d4ac73fa49ce155cf2e6937faf39911d4f
https://github.com/python/cpython/pull/161069/files#diff-bc8499ed0d5bebcd8e193fed4430a5d4ac73fa49ce155cf2e6937faf39911d4f
https://github.com/python/cpython/pull/161069/files#diff-bc8499ed0d5bebcd8e193fed4430a5d4ac73fa49ce155cf2e6937faf39911d4f
https://github.com/python/cpython/pull/161069/files#diff-bc8499ed0d5bebcd8e193fed4430a5d4ac73fa49ce155cf2e6937faf39911d4f
https://github.com/python/cpython/pull/161069/files#diff-bc8499ed0d5bebcd8e193fed4430a5d4ac73fa49ce155cf2e6937faf39911d4f
https://github.com/python/cpython/pull/161069/files#diff-bc8499ed0d5bebcd8e193fed4430a5d4ac73fa49ce155cf2e6937faf39911d4f
https://github.com/python/cpython/pull/161069/files#diff-bc8499ed0d5bebcd8e193fed4430a5d4ac73fa49ce155cf2e6937faf39911d4f
https://github.com/python/cpython/pull/161069/files#diff-bc8499ed0d5bebcd8e193fed4430a5d4ac73fa49ce155cf2e6937faf39911d4f
https://github.com/python/cpython/pull/161069/files#diff-bc8499ed0d5bebcd8e193fed4430a5d4ac73fa49ce155cf2e6937faf39911d4f
https://github.com/python/cpython/pull/161069/files#diff-bc8499ed0d5bebcd8e193fed4430a5d4ac73fa49ce155cf2e6937faf39911d4f
https://github.com/python/cpython/pull/161069/files#diff-bc8499ed0d5bebcd8e193fed4430a5d4ac73fa49ce155cf2e6937faf39911d4f
https://github.com/python/cpython/pull/161069/files#diff-bc8499ed0d5bebcd8e193fed4430a5d4ac73fa49ce155cf2e6937faf39911d4f
https://github.com/python/cpython/pull/161069/files#diff-bc8499ed0d5bebcd8e193fed4430a5d4ac73fa49ce155cf2e6937faf39911d4f
https://github.com/python/cpython/pull/161069/files#diff-bc8499ed0d5bebcd8e193fed4430a5d4ac73fa49ce155cf2e6937faf39911d4f
https://github.com/python/cpython/pull/161069/files#diff-bc8499ed0d5bebcd8e193fed4430a5d4ac73fa49ce155cf2e6937faf39911d4f
https://github.com/python/cpython/pull/161069/files#diff-bc8499ed0d5bebcd8e193fed4430a5d4ac73fa49ce155cf2e6937faf39911d4f
https://github.com/python/cpython/pull/161069/files#diff-bc8499ed0d5bebcd8e193fed4430a5d4ac73fa49ce155cf2e6937faf39911d4f
https://github.com/python/cpython/blob/3.15/.github/CODEOWNERS#L398
Modules/cjkcodecs/multibytecodec.hhttps://github.com/python/cpython/pull/161069/files#diff-23d48615b15bc60579de4ec68b088b6a59fdb8ae6156d6bf2d7ca969b013786d
View file https://github.com/gpshead/cpython/blob/be35cbe3ce2de98c6acca6999a49693c17428753/Modules/cjkcodecs/multibytecodec.h
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/161069/{{ revealButtonHref }}
https://github.com/python/cpython/pull/161069/files#diff-23d48615b15bc60579de4ec68b088b6a59fdb8ae6156d6bf2d7ca969b013786d
https://github.com/python/cpython/pull/161069/files#diff-23d48615b15bc60579de4ec68b088b6a59fdb8ae6156d6bf2d7ca969b013786d
https://github.com/python/cpython/pull/161069/files#diff-23d48615b15bc60579de4ec68b088b6a59fdb8ae6156d6bf2d7ca969b013786d
Please reload this pagehttps://github.com/python/cpython/pull/161069/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.