[Python-Dev] unicode Exception messages in py2.7 (original) (raw)

Benjamin Peterson benjamin at python.org
Thu Nov 14 22:02:40 CET 2013


2013/11/14 Chris Barker <chris.barker at noaa.gov>:

So a proposal:

Use 'replace" mode for the encoding to the default, and at least the user would see SOMETHING of the message. In a common case, it would be a lot of ascii, and in the worse case it would be a lot of question marks -- still better than a totally blank message. Another option would be to use the str(repr(themessage)) so the user would get the escaped version. Though I think that would be more ugly.

Unfortunately both of these things change behavior so cannot be changed in Python 2.7.

What am I missing? This seems so obvious, and easy to do (though maybe it's buried in the C implementation of Exceptions)

-- Regards, Benjamin



More information about the Python-Dev mailing list