I have this problem where I need to unescape the json string. To have & instead of & ;
From python dictionary I do this; where record_prev is a python dictionary
record_prev = self.stringify(app)
record_prev = record_prev.decode('string_escape')
response = make_response(
record_prev,
200
)
response.mimetype = "application/json"
Stringify function:
def stringify(self, app=None):
record_prev = copy.deepcopy( self.response )
if app != None:
app.logger.debug( record_prev["message_data"] )
return json.dumps( record_prev )
#end def
Im having an issue on record_prev = record_prev.decode('string_escape')
It throws
AttributeError: 'str' object has no attribute 'decode'