GeezerVison is showing github.com — gh-160306: Fix iso2022_jp_3 decoding of the JIS X 0213:2000 plane 2 mapping by kinqsradio · Pull Request #160702 · python/cpython
Conversation
kinqsradio
commented
Oct 26, 2026
•
edited by bedevere-app
Bot
Loading
Uh oh!
There was an error while loading. Please reload this page.
The JIS X 0213:2000 plane 2 emulation sets U+9B1D for cell 0x7D3B, but the following independent table lookup overwrites it with the 2004 mapping, U+9B1C. Make that lookup an else if, matching the adjacent plane 1 decoder and the EUC/Shift_JIS implementations.
The regression test checks the exact encoding and round trip, every two-chunk incremental decode split, and stream reading for both iso2022_jp_3 and iso2022_jp_2004. The latter retains U+9B1C.
Validation on a macOS arm64 debug build of current main (c436e8d83597):
- The new regression fails before the C change and passes afterward.
./python.exe -m test -j2 test_multibytecodec test_codecencodings_iso2022 test_codecencodings_jp test_codecencodings_cn test_codecencodings_kr test_codecencodings_tw test_codecencodings_hk test_codecs: passed (756 tests run, 17 skipped).
./python.exe -m test -R 3:3 test_multibytecodec test_codecencodings_iso2022: passed.
- Comparing all 35,344 plane 1 and plane 2 decode results across both ISO-2022 codec editions before and after the change found only the intended
iso2022_jp_3 cell change, including unchanged invalid-cell results.
make patchcheck, Ruff, NEWS lint, and git diff --check: passed.
AI assistance was used to implement and validate this change.
Fixes #160306.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Reviewers
corona10
Awaiting requested review from corona10
corona10 is a code owner
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.