Matthew Barnett added the comment: It occurred to me that the truncation of the string when building the error message could cause a UnicodeDecodeError:
>>> int("1".ljust(199) + "\u0100") Traceback (most recent call last): File "<pyshell#0>", line 1, in <module> int("1".ljust(199) + "\u0100") UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc4 in position 199: unexpected end of data This is because it's truncating a UTF-8 string, and the truncation is in the middle of a multi-byte sequence. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue16741> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com