class documentation

class SafeString(object):

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'):

Undocumented

def __str__(self):

Undocumented

def __unicode__(self):

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 =

Undocumented

decoding_errors =

Undocumented

encoding =

Undocumented

encoding_errors =

Undocumented