FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

[3.15] gh-153862: Fix curses window.inch() for non-ASCII characters on a wide build (GH-153863) by serhiy-storchaka · Pull Request #154116 · python/cpython · GitHub

Repository navigation

[3.15] gh-153862: Fix curses window.inch() for non-ASCII characters on a wide build (GH-153863) - #154116

Merged
serhiy-storchaka merged 1 commit into
python:3.15from
serhiy-storchaka:backport-3.15-curses-inch
Jul 19, 2026
Merged

serhiy-storchaka merged 1 commit into
python:3.15from
serhiy-storchaka:backport-3.15-curses-inch

Conversation

serhiy-storchaka commented Jul 19, 2026 •
edited by bedevere-app Bot
Loading

Copy link
Copy Markdown
Member

Manual backport of #153863.

3.15 predates the 3.16 complexchar refactor, so the fix inlines getcchar() into a small helper instead of the curses_getcchar wrapper; the logic (recover the locale byte via wctob()) is unchanged.

Verified on a wide (HAVE_NCURSESW) build: test_curses passes, including test_read_from_window under ISO-8859-15 where € (0xA4) exercises the fix.

… a wide build (pythonGH-153863)

On a wide build, winch() returns the low 8 bits of the character's code
point with no locale conversion, so inch()/mvinch() disagreed with instr()
for a non-ASCII character of an 8-bit locale ('€' under ISO-8859-15 gave
0xAC instead of 0xA4).  Re-encode the cell to its locale byte via wctob(),
as ncurses does for getbkgd().

(cherry picked from commit a83aaa9)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

Copy link
Copy Markdown

serhiy-storchaka added needs backport to 3.13 only security fixes needs backport to 3.14 bugs and security fixes labels Jul 19, 2026
serhiy-storchaka enabled auto-merge (squash) July 19, 2026 12:19
serhiy-storchaka merged commit 7d1b64b into python:3.15 Jul 19, 2026
67 checks passed

Copy link
Copy Markdown

Thanks @serhiy-storchaka for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14.
🐍🍒⛏🤖

Copy link
Copy Markdown

Sorry, @serhiy-storchaka, I could not cleanly backport this to 3.14 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker 7d1b64bd9a07deb4ce20e0f3d1b07b0507c51431 3.14

Copy link
Copy Markdown

Sorry, @serhiy-storchaka, I could not cleanly backport this to 3.13 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker 7d1b64bd9a07deb4ce20e0f3d1b07b0507c51431 3.13

serhiy-storchaka removed needs backport to 3.14 bugs and security fixes needs backport to 3.13 only security fixes labels Jul 19, 2026
serhiy-storchaka deleted the backport-3.15-curses-inch branch August 27, 2026 12:13
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant


Back | FazBrowse Home | New Git URL