#NEWLINE# def loads( self , msg , encoding = None ) : #NEWLINE# #INDENT# '\n        Run the correct loads serialization format\n\n        :param encoding: Useful for Python 3 support. If the msgpack data\n                         was encoded using "use_bin_type=True", this will\n                         differentiate between the \'bytes\' type and the\n                         \'str\' type by decoding contents with \'str\' type\n                         to what the encoding was set as. Recommended\n                         encoding is \'utf-8\' when using Python 3.\n                         If the msgpack data was not encoded using\n                         "use_bin_type=True", it will try to decode\n                         all \'bytes\' and \'str\' data (the distinction has\n                         been lost in this case) to what the encoding is\n                         set as. In this case, it will fail if any of\n                         the contents cannot be converted.\n        ' #NEWLINE# try : #NEWLINE# #INDENT# gc . disable ( ) #NEWLINE# if ( msgpack . version >= ( 0 , 4 , 0 ) ) : #NEWLINE# #INDENT# return msgpack . loads ( msg , use_list = True , encoding = encoding ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return msgpack . loads ( msg , use_list = True ) #NEWLINE# #UNINDENT# #UNINDENT# except Exception as exc : #NEWLINE# #INDENT# log . critical ( 'Could not deserialize msgpack message: {0}This often happens when trying to read a file not in binary mode.Please open an issue and include the following error: {1}' . format ( msg , exc ) ) #NEWLINE# raise #NEWLINE# #UNINDENT# finally : #NEWLINE# #INDENT# gc . enable ( )