def sanitise_json_error(error_dict):
 ret = copy.copy(error_dict)
 chop = len(JSON_ERROR)
 ret[u'detail'] = ret[u'detail'][:chop]
 return ret

def sanitise_json_error ( error_dict ) : ret = copy . copy ( error_dict ) chop = len ( JSON_ERROR ) ret [ u'detail' ] = ret [ u'detail' ] [ : chop ] return ret
exact contents of json error messages depend on the installed version of json .