Bugs item #1012952, was opened at 2004-08-20 08:09 Message generated for change (Comment added) made by bcannon You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1012952&group_id=5470
Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None >Status: Closed >Resolution: Fixed Priority: 5 Submitted By: Marius Gedminas (mgedmin) Assigned to: Nobody/Anonymous (nobody) Summary: Standard exceptions are hostile to Unicode Initial Comment: >>> e = ValueError(u"\u2639") >>> str(e) ... UnicodeEncodeError: 'ascii' codec can't encode character u'\u2639' in position 0: ordinal not in range(128) >>> unicode(e) ... UnicodeEncodeError: 'ascii' codec can't encode character u'\u2639' in position 0: ordinal not in range(128) Please add a __unicode__ method to Exception. I suggest the following semantics: class UnicodeAwareException(Exception): def __unicode__(self): return u" ".join(map(unicode, self.args)) ---------------------------------------------------------------------- >Comment By: Brett Cannon (bcannon) Date: 2006-02-28 20:35 Message: Logged In: YES user_id=357491 Rev. 42711 (PEP 352) adds a proper __unicode__ to the built-in exceptions. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1012952&group_id=5470 _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com