]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.14] gh-154580: Fix python-gdb.py pretty-printing non-ASCII strings in non-UTF... 3.14
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Fri, 24 Jul 2026 17:46:28 +0000 (19:46 +0200)
committerGitHub <noreply@github.com>
Fri, 24 Jul 2026 17:46:28 +0000 (17:46 +0000)
commitaba6bb9e44769122ef4f96ddfc65e726c2dc3b2c
tree930d9f5aede681a74fd8ec6e5c442e07f48f6154
parenta722c8d45aa64a6940bfbd7297534dbcd0e89c2b
[3.14] gh-154580: Fix python-gdb.py pretty-printing non-ASCII strings in non-UTF-8 locales (GH-154581) (GH-154636)

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>
Lib/test/test_gdb/test_pretty_print.py
Lib/test/test_gdb/util.py
Misc/NEWS.d/next/Tools-Demos/2026-07-24-09-30-00.gh-issue-154580.Kp3nQ2.rst [new file with mode: 0644]
Tools/gdb/libpython.py