mirror of
https://github.com/python/cpython
synced 2026-11-20 05:24:14 +03:00
gh-158451: Fix python-gdb.py for invalid Unicode strings (GH-158475)
python-gdb.py is now able to format an invalid Unicode string:
render invalid characters as "\Uhhhhhhhh" instead of raising an
exception.
The PyUnicodeWriter API fills a UCS-4 buffer with 0xff byte pattern
to detect usage of uninitialized characters. It produces invalid
characters '\Uffffffff'.
PyBytesObjectPtr now iterates on bytes (list of integers), instead of
creating a temporary Unicode string. Add more bytes tests in test_gdb
pretty printer.
Remove the unused 'ch2' variable.
(cherry picked from commit
|
||
|---|---|---|
| .. | ||
| libpython.py | ||