]> granicus.if.org Git - python/commit
libpython.py: py-bt commands escape unencodable characters
authorVictor Stinner <victor.stinner@haypocalc.com>
Tue, 17 Aug 2010 22:49:25 +0000 (22:49 +0000)
committerVictor Stinner <victor.stinner@haypocalc.com>
Tue, 17 Aug 2010 22:49:25 +0000 (22:49 +0000)
commit0e5a41b8f5b87bf07ed6368df5a84137d3e4e4da
tree0aa8ac3b1b77729645b770c27b205f030a033d91
parent6961bd690e617b963a55ce86a640eedb590bc23b
libpython.py: py-bt commands escape unencodable characters

Encode unicode strings to the terminal encoding with backslashreplace error (as
Python does for sys.stderr) before writing them to sys.stdout. It fixes
UnicodeEncodeError on writing non-ascii characters in an ascii terminal (C
locale: ASCII encoding).
Tools/gdb/libpython.py