Skip to content

[3.14] gh-154580: Fix python-gdb.py pretty-printing non-ASCII strings in non-UTF-8 locales (GH-154581)#154636

Merged
serhiy-storchaka merged 1 commit into
python:3.14from
miss-islington:backport-6cb93bd-3.14
Jul 24, 2026
Merged

[3.14] gh-154580: Fix python-gdb.py pretty-printing non-ASCII strings in non-UTF-8 locales (GH-154581)#154636
serhiy-storchaka merged 1 commit into
python:3.14from
miss-islington:backport-6cb93bd-3.14

Conversation

@miss-islington

@miss-islington miss-islington commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

The gdb pretty-printer used locale.getpreferredencoding() to decide whether to
escape a character, but gdb writes its output in its host charset. Use
gdb.host_charset() instead. test_strings had the same problem.
(cherry picked from commit 6cb93bd)

Co-authored-by: Serhiy Storchaka storchaka@gmail.com
Co-authored-by: Claude Opus 4.8 noreply@anthropic.com

…in non-UTF-8 locales (pythonGH-154581)

The gdb pretty-printer used locale.getpreferredencoding() to decide whether to
escape a character, but gdb writes its output in its host charset.  Use
gdb.host_charset() instead.  test_strings had the same problem.
(cherry picked from commit 6cb93bd039ec1c5e0909d2d75cfc4fb3641c693b)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
@serhiy-storchaka
serhiy-storchaka enabled auto-merge (squash) July 24, 2026 16:35
@serhiy-storchaka
serhiy-storchaka merged commit aba6bb9 into python:3.14 Jul 24, 2026
85 of 89 checks passed
@miss-islington
miss-islington deleted the backport-6cb93bd-3.14 branch July 24, 2026 17:46
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.

2 participants