Skip to content

Commit

Permalink
make ppjson a little bit more best-effort by unicode()-ing nonjsonables
Browse files Browse the repository at this point in the history
  • Loading branch information
mahmoud committed Dec 10, 2018
1 parent 09a3e24 commit e5a7b92
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ashes.py
Original file line number Diff line number Diff line change
Expand Up @@ -1003,7 +1003,7 @@ def pp_filter(val):
def ppjson_filter(val):
"A best-effort pretty-printing filter, based on the JSON module"
try:
return json.dumps(val, indent=JSON_PP_INDENT, sort_keys=True)
return json.dumps(val, indent=JSON_PP_INDENT, sort_keys=True, default=unicode)
except TypeError:
return to_unicode(val)

Expand Down

0 comments on commit e5a7b92

Please sign in to comment.