Error reporting should be safe from encoding/decoding errors. However, implicit conversions of strings and exceptions like
>>> u'%s world: %s' % ('Hällo', Exception(u'Hällo')
fail in some Python versions:
__str__
and fails with non-ASCII chars in`unicode` arguments.
(work around http://bugs.python.org/issue2517):unicode
arguments.The SafeString
, ErrorString
and ErrorOutput
classes handle
common exceptions.
Class | ErrorOutput |
Wrapper class for file-like error streams with failsave de- and encoding of str , bytes , unicode and Exception instances. |
Class | ErrorString |
Safely report exception type and message. |
Class | SafeString |
A wrapper providing robust conversion to str and unicode . |
Variable | locale_encoding |
Undocumented |