#NEWLINE# @ cached_property #NEWLINE# def message( self ) : #NEWLINE# #INDENT# 'The formatted message.' #NEWLINE# if ( not ( self . args or self . kwargs ) ) : #NEWLINE# #INDENT# return self . msg #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# return self . _format_message ( self . msg , * self . args , ** self . kwargs ) #NEWLINE# #UNINDENT# except UnicodeDecodeError : #NEWLINE# #INDENT# msg = self . msg . encode ( 'utf-8' , 'replace' ) #NEWLINE# return self . _format_message ( msg , * self . args , ** self . kwargs ) #NEWLINE# #UNINDENT# except ( UnicodeEncodeError , AttributeError ) : #NEWLINE# #INDENT# if ( ( sys . exc_info ( ) [ 0 ] is AttributeError ) and ( PY2 or ( not isinstance ( self . msg , bytes ) ) ) ) : #NEWLINE# #INDENT# raise #NEWLINE# #UNINDENT# msg = self . msg . decode ( 'utf-8' , 'replace' ) #NEWLINE# return self . _format_message ( msg , * self . args , ** self . kwargs ) #NEWLINE# #UNINDENT# #UNINDENT# except Exception : #NEWLINE# #INDENT# e = sys . exc_info ( ) [ 1 ] #NEWLINE# errormsg = 'Could not format message with provided arguments: {err}\n  msg={msg!r}\n  args={args!r} \n  kwargs={kwargs!r}.\nHappened in file {file}, line {lineno}' . format ( err = e , msg = self . msg , args = self . args , kwargs = self . kwargs , file = self . filename , lineno = self . lineno ) #NEWLINE# if PY2 : #NEWLINE# #INDENT# errormsg = errormsg . encode ( 'utf-8' ) #NEWLINE# #UNINDENT# raise TypeError ( e )