Skip to content

Commit bcc7bc7

Browse files
committed
make the Chinese stringify result readable.
1 parent fa10302 commit bcc7bc7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/HttpLibrary/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -547,7 +547,7 @@ def stringify_json(self, data):
547547
"""
548548

549549
try:
550-
return json.dumps(data)
550+
return json.dumps(data, ensure_ascii=False)
551551
except ValueError, e:
552552
raise ValueError(
553553
"Could not stringify '%r' to JSON: %s" % (data, e))
@@ -618,7 +618,7 @@ def log_json(self, json_string, log_level='INFO'):
618618
"""
619619
Logs a pretty printed version of the JSON document `json_string`.
620620
"""
621-
for line in json.dumps(json_string, indent=2).split('\n'):
621+
for line in json.dumps(json_string, indent=2, ensure_ascii=False).split('\n'):
622622
logger.write(line, log_level)
623623

624624
# debug

0 commit comments

Comments
 (0)