[issue2382] [Py3k] SyntaxError cursor shifted if multibyte character is in line.
Amaury Forgeot d'Arc
report at bugs.python.org
Wed Oct 1 01:52:08 CEST 2008
Amaury Forgeot d'Arc <amauryfa at gmail.com> added the comment:
I think that your patch works only for terminals where one byte of the
encoded text is displayed as one character on the terminal. This is not
true for utf-8 terminals, for example.
In the attached patch, I tried to write some unit tests, (I had to adapt
the traceback module as well), and one test still fails because the
captured stderr has a utf-8 encoding.
I think that it's better to count unicode characters.
Added file: http://bugs.python.org/file11670/traceback_adjust_cursor.patch
Python tracker <report at bugs.python.org>
More information about the Python-bugs-list