Provisional module to handle Exceptions across Python versions.
This module will be deprecated with the end of support for Python 2.7 and be removed in Docutils 1.2.
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 failsafe 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 |