This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients amaury.forgeotdarc, ezio.melotti, gthb, michael.foord, vstinner
Date 2010-05-04.15:17:05
SpamBayes Score 5.4695225e-05
Marked as misclassified No
Message-id <1272986227.27.0.200775794134.issue8313@psf.upfronthosting.co.za>
In-reply-to
Content
Attached patch fixes _some_str() function of the traceback module: encode unicode exception message to ASCII using backslashreplace error handler. ASCII is not the best choice, but str(unicode(...)) uses also ASCII (the default encoding) and we don't know the terminal encoding in traceback. We cannot do better here in Python2 (without breaking a lot of APIs...).

The right fix is to use Python3 which formats a traceback to unicode (unicode characters of the error message are kept unchanged). The choice of the encoding and error handler is made only at the end, when writing the output to the terminal, which is the right thing to do.
History
Date User Action Args
2010-05-04 15:17:07vstinnersetrecipients: + vstinner, amaury.forgeotdarc, ezio.melotti, michael.foord, gthb
2010-05-04 15:17:07vstinnersetmessageid: <1272986227.27.0.200775794134.issue8313@psf.upfronthosting.co.za>
2010-05-04 15:17:05vstinnerlinkissue8313 messages
2010-05-04 15:17:05vstinnercreate