From 8fb94e9a2d75cfbc5587c77e9d0b213f81d9b7be Mon Sep 17 00:00:00 2001 From: Henrique Nakashima Date: Thu, 10 Aug 2017 16:47:07 -0400 Subject: Fixing utf-8 safetynet_conclusions problem when writing the json. The previous fix (encoding on print) breaks when running compare.py directly. The real problem was in writing the json. Change-Id: Ie4cf926b5c6153731c1ae187ec6a7cffa74ce67b Reviewed-on: https://pdfium-review.googlesource.com/10653 Reviewed-by: Ryan Harrison Commit-Queue: Henrique Nakashima --- testing/tools/safetynet_compare.py | 2 +- testing/tools/safetynet_conclusions.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'testing') diff --git a/testing/tools/safetynet_compare.py b/testing/tools/safetynet_compare.py index e54bec5366..028dd02232 100755 --- a/testing/tools/safetynet_compare.py +++ b/testing/tools/safetynet_compare.py @@ -539,7 +539,7 @@ class CompareRun(object): ComparisonConclusions.GetOutputDict(). """ if self.args.machine_readable: - print json.dumps(conclusions_dict) + print json.dumps(conclusions_dict, ensure_ascii=False) else: PrintConclusionsDictHumanReadable( conclusions_dict, colored=True, key=self.args.case_order) diff --git a/testing/tools/safetynet_conclusions.py b/testing/tools/safetynet_conclusions.py index 0761a91043..112274e669 100644 --- a/testing/tools/safetynet_conclusions.py +++ b/testing/tools/safetynet_conclusions.py @@ -274,7 +274,7 @@ def PrintConclusionsDictHumanReadable(conclusions_dict, colored, key=None): print '{0} {1:15,d} {2}' .format( color.format('{:+11.4%}'.format(case_dict['ratio'])), case_dict['after'], - case_name.encode('utf-8')) + case_name) # Print totals totals = conclusions_dict['summary'] -- cgit v1.2.3