Closed toconnell closed 6 years ago
Fixed this with a quick type check.
Re-opening. This is still broken. It's more broken now, in fact.
Some of the email error traffic from production:
User OID: 5a808c378740d951e57ef241 Method: POST URL: http://api.thewatcher.io/survivor/toggle_damage/5a7f4b018740d951e57ed529 JSON: {u'location': u'arms_damage_light', u'serialize_on_response': True}
Traceback (most recent call last): File "/home/toconnell/kdm-manager/v2/api/utils.py", line 539, in wrapper return log_event_call(self, *args, **kwargs) File "/home/toconnell/kdm-manager/v2/api/Models.py", line 966, in log_event d['event'] = d['event'].decode('ascii','replace').encode('utf-8','replace') UnicodeEncodeError: 'ascii' codec can't encode character u'\u201c' in position 58: ordinal not in range(128)
User OID: 5a808c378740d951e57ef241 Method: POST URL: http://api.thewatcher.io/survivor/rm_game_asset/5a7f4b018740d951e57ed529 JSON: {u'type': u'fighting_arts', u'handle': u'strategist', u'serialize_on_response': True}
Traceback (most recent call last): File "/home/toconnell/kdm-manager/v2/api/utils.py", line 539, in wrapper return log_event_call(self, *args, **kwargs) File "/home/toconnell/kdm-manager/v2/api/Models.py", line 966, in log_event d['event'] = d['event'].decode('ascii','replace').encode('utf-8','replace') UnicodeEncodeError: 'ascii' codec can't encode character u'\u201c' in position 53: ordinal not in range(128)
User OID: 5a059dcd8740d946a02defcf Method: POST URL: http://api.thewatcher.io/survivor/replace_game_assets/5a929cbd8740d96210f0230d JSON: {u'type': u'fighting_arts', u'handles': [u'crazed'], u'user_id': u'5a059dcd8740d946a02defcf', u'serialize_on_response': True}
Traceback (most recent call last): File "/home/toconnell/kdm-manager/v2/api/utils.py", line 539, in wrapper return log_event_call(self, *args, **kwargs) File "/home/toconnell/kdm-manager/v2/api/Models.py", line 966, in log_event d['event'] = d['event'].decode('ascii','replace').encode('utf-8','replace') UnicodeEncodeError: 'ascii' codec can't encode character u'\xc4' in position 38: ordinal not in range(128)
Looks like this is duplicative now, and is causing the error:
d['event'] = d['event'].decode('ascii','replace').encode('utf-8','replace')
Alright, I'm closing this again. I really thing it's fixed now.