Merge pull request #2956 from akerl/unicodefix
ignore unicode errors in stdout
This commit is contained in:
commit
159ba7d68a
1 changed files with 3 additions and 0 deletions
|
@ -127,6 +127,9 @@ def jsonify(result, format=False):
|
|||
if result is None:
|
||||
return "{}"
|
||||
result2 = result.copy()
|
||||
for key, value in result2.items():
|
||||
if type(value) is str:
|
||||
result2[key] = value.decode('utf-8', 'ignore')
|
||||
if format:
|
||||
return json.dumps(result2, sort_keys=True, indent=4)
|
||||
else:
|
||||
|
|
Loading…
Reference in a new issue