From 9c0bbbd248fa2eac998ec732c854553551f29a3f Mon Sep 17 00:00:00 2001 From: debugtalk Date: Wed, 20 Feb 2019 11:53:04 +0800 Subject: [PATCH] bugfix: dump file with Chinese charactor in Python 3 --- httprunner/utils.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/httprunner/utils.py b/httprunner/utils.py index 88eecacd..79d7d130 100644 --- a/httprunner/utils.py +++ b/httprunner/utils.py @@ -661,7 +661,13 @@ def dump_json_file(json_data, pwd_dir_path, dump_file_name): )) ) else: - json.dump(json_data, outfile, indent=4, separators=(',', ':')) + json.dump( + json_data, + outfile, + indent=4, + separators=(',', ':'), + ensure_ascii=False + ) msg = "dump file: {}".format(dump_file_path) logger.color_print(msg, "BLUE")