[issue19308] Tools/gdb/libpython.py does not support GDB linked against Python 3

David Coles report at bugs.python.org
Mon Oct 21 03:23:50 CEST 2013


David Coles added the comment:

I ended up with a very similar looking patch - and so merged my changes into Pitrou's patch.

I also had a go at fixing up the `test_gdb` unit test, which revealed a few more string/unicode issues. Finally tracked them down to the `write_unicode` function. Sadly the `write` function in GDB's Python API only accepts unicode strings, hence we must pre-backslash escape for C-string encoding (either Python's default encoding or utf-8 in Python 3.1+) then turn it back into a unicode string again to avoid a TypeError. Yuck.

The patch almost applies on Python 2.7, but needs a little bit of massaging due to slight differences in Tools/gdb/libpython.py. Need to test the new unicode changes haven't broken anything and then I'll upload a patch for Python 2.7.

----------
Added file: http://bugs.python.org/file32271/gdb_py3.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue19308>
_______________________________________


More information about the Python-bugs-list mailing list