From 73792117e87482077a95c472b254c8b51719bcfd Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Fri, 3 Jul 2015 20:55:24 -0700 Subject: Force utf-8 output for `spec_test.py --dump-tests`. Closes #344. --- test/spec_tests.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/spec_tests.py b/test/spec_tests.py index be11f12..392049d 100755 --- a/test/spec_tests.py +++ b/test/spec_tests.py @@ -124,7 +124,7 @@ if __name__ == "__main__": pattern_re = re.compile('.') tests = [ test for test in all_tests if re.search(pattern_re, test['section']) and (not args.number or test['example'] == args.number) ] if args.dump_tests: - print(json.dumps(tests, ensure_ascii=False, indent=2)) + sys.stdout.buffer.write(json.dumps(tests, ensure_ascii=False, indent=2).encode('utf-8')) exit(0) else: skipped = len(all_tests) - len(tests) -- cgit v1.2.3