[issue2382] [Py3k] SyntaxError cursor shifted if multibyte character is in line.

Amaury Forgeot d'Arc report at bugs.python.org
Thu Oct 2 00:31:40 CEST 2008


Amaury Forgeot d'Arc <amauryfa at gmail.com> added the comment:

This seems to be a difficult problem. Doesn't the exact width depend on 
the terminal capabilities? and fonts, and combining diacritics...

An easy way to put the caret at the same exact position is to repeat the 
beginning of the line up to the offending offset:
   print "あいうえお"
   print "あいうえお^<------------------
But I don't know how to make it look less ugly.

At least my "one unicode char is one space" suggestion corrects the case 
of Western languages, and all messages with single-width characters.

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


More information about the Python-bugs-list mailing list