Commit 2adc3354 by Les Aker

ignore unicode errors in stdout

parent 14aa5417
...@@ -127,6 +127,9 @@ def jsonify(result, format=False): ...@@ -127,6 +127,9 @@ def jsonify(result, format=False):
if result is None: if result is None:
return "{}" return "{}"
result2 = result.copy() result2 = result.copy()
for key, value in result2.items():
if type(value) is str:
result2[key] = value.decode('utf-8', 'ignore')
if format: if format:
return json.dumps(result2, sort_keys=True, indent=4) return json.dumps(result2, sort_keys=True, indent=4)
else: else:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment