always use unicode function from compat module when encoding log messages

This commit is contained in:
Alan Hamlett 2015-03-23 15:05:37 -07:00
parent 373ebf933f
commit 1a6f588d94

View file

@ -24,9 +24,6 @@ except ImportError:
class CustomEncoder(json.JSONEncoder):
def default(self, obj):
if isinstance(obj, bytes):
obj = bytes.decode(obj)
return json.dumps(obj)
try:
encoded = super(CustomEncoder, self).default(obj)
except UnicodeDecodeError: