module documentation

Deprecated module to handle Exceptions across Python versions. .. warning:: This module is deprecated with the end of support for Python 2.7 and will be removed in Docutils 0.21 or later. Replacements: | SafeString -> str | ErrorString -> docutils.io.error_string() | ErrorOutput -> docutils.io.ErrorOutput 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: * In Python <= 2.6, ``unicode(<exception instance>)`` uses `__str__` and fails with non-ASCII chars in`unicode` arguments. (work around http://bugs.python.org/issue2517): * In Python 2, unicode(<exception instance>) fails, with non-ASCII chars in arguments. (Use case: in some locales, the errstr argument of IOError contains non-ASCII chars.) * In Python 2, str(<exception instance>) fails, with non-ASCII chars in `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`.