parameters: (self)
docstring: Find a unicode representation of self.error
docstring_summary: Find a unicode representation of self.error
docstring_tokens: Find a unicode representation of self . error
function: def _init_message(self):
          """Find a unicode representation of self.error"""
          try:
              self.message = compat.text_type(self.error)
          except UnicodeError:
              try:
                  self.message = str(self.error)
              except UnicodeEncodeError:
                  # Fallback to args as neither unicode nor
                  # str(Exception(u'\xe6')) work in Python < 2.6
                  self.message = self.error.args[0]
          if not isinstance(self.message, compat.text_type):
              self.message = compat.text_type(self.message, "ascii", "replace")
function_tokens: def _init_message ( self ) : try : self . message = compat . text_type ( self . error ) except UnicodeError : try : self . message = str ( self . error ) except UnicodeEncodeError : # Fallback to args as neither unicode nor # str(Exception(u'\xe6')) work in Python < 2.6 self . message = self . error . args [ 0 ] if not isinstance ( self . message , compat . text_type ) : self . message = compat . text_type ( self . message , "ascii" , "replace" )