"Fix" printing of gdb.Values with non-ascii characters or unicode ordinals
authorMark Florisson <markflorisson88@gmail.com>
Thu, 2 Dec 2010 20:57:02 +0000 (21:57 +0100)
committerMark Florisson <markflorisson88@gmail.com>
Thu, 2 Dec 2010 20:57:02 +0000 (21:57 +0100)
Cython/Debugger/libpython.py

index 38bc7b81775d6cca090beabd13e04001f17ab558..07a57a49c0f7dde4fed380bb4f6c2cc63a4424cd 100644 (file)
@@ -59,6 +59,10 @@ import itertools
 
 import gdb
 
+# I think this is the only way to fix this bug :'(
+# http://sourceware.org/bugzilla/show_bug.cgi?id=12285
+reload(sys).setdefaultencoding('UTF-8')
+
 # Look up the gdb.Type for some standard types:
 _type_char_ptr = gdb.lookup_type('char').pointer() # char*
 _type_unsigned_char_ptr = gdb.lookup_type('unsigned char').pointer() # unsigned char*