class documentation

class SafeString(object): (source)

Known subclasses: docutils.utils.error_reporting.ErrorString

View In Hierarchy

A wrapper providing robust conversion to str and unicode.
Method __init__ Undocumented
Method __str__ Undocumented
Method __unicode__ Return unicode representation of self.data.
Instance Variable data Undocumented
Instance Variable decoding​_errors Undocumented
Instance Variable encoding Undocumented
Instance Variable encoding​_errors Undocumented
def __init__(self, data, encoding=None, encoding_errors='backslashreplace', decoding_errors='replace'): (source)

Undocumented

def __str__(self): (source)

Undocumented

def __unicode__(self): (source)

Return unicode representation of self.data.

Try unicode(self.data), catch UnicodeError and

  • if self.data is an Exception instance, work around http://bugs.python.org/issue2517 with an emulation of Exception.__unicode__,
  • else decode with self.encoding and self.decoding_errors.
data = (source)

Undocumented

decoding_errors = (source)

Undocumented

encoding = (source)

Undocumented

encoding_errors = (source)

Undocumented