Closed toconnell closed 6 years ago
Just assuming that we've got ASCII incoming on everything from now on and doing some preemptive encode() calls to fix this:
@@ -831,10 +832,14 @@ class UserAsset(object):
# baseline attributes
#
+ # for those who still raw-dog it; force to ASCII:
+ if msg is not None:
+ msg = msg.encode("ascii",'ignore')
+
# 1.) event: determine event type if it's None
if event_type is None:
@@ -848,10 +853,12 @@ class UserAsset(object):
# 3.) key: default the key if we don't get one
if key is None:
key = " ".join(method.split("_")[1:])
+ key = key.encode('ascii','ignore')
# 4.) value; default the value if we don't get one
if value is None:
value = "UNKNOWN"
+ value = value.encode('ascii','ignore')