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 serhiy.storchaka
Recipients Nam.Nguyen, arigo, eric.araujo, ezio.melotti, lemburg, liori, r.david.murray, serhiy.storchaka, vstinner
Date 2013-08-23.13:31:13
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1377264673.35.0.367417638823.issue5876@psf.upfronthosting.co.za>
In-reply-to
Content
In Python 3 ascii() uses the backslashreplace error handler.

>>> class T:
...     def __repr__(self):
...         return '\u20ac\udcff'
... 
>>> print(ascii(T()))
\u20ac\udcff

I think using the backslashreplace error handler in repr() in Python 2.7 is good solution. Here is a patch.
History
Date User Action Args
2013-08-23 13:31:13serhiy.storchakasetrecipients: + serhiy.storchaka, lemburg, arigo, vstinner, ezio.melotti, eric.araujo, r.david.murray, liori, Nam.Nguyen
2013-08-23 13:31:13serhiy.storchakasetmessageid: <1377264673.35.0.367417638823.issue5876@psf.upfronthosting.co.za>
2013-08-23 13:31:13serhiy.storchakalinkissue5876 messages
2013-08-23 13:31:13serhiy.storchakacreate