[test] Open file in UTF-8

It is 2021 and Python still does not default to UTF-8 on Windows!
This commit is contained in:
Khaled Hosny 2021-07-30 02:20:19 +02:00
parent bafbade087
commit f6c67a5fcf
1 changed files with 2 additions and 1 deletions

View File

@ -56,7 +56,8 @@ def run_test (test, should_check_ots):
if return_code:
return fail_test (test, cli_args, "%s returned %d" % (' '.join (cli_args), return_code))
with open(os.path.join (test_suite.get_output_directory (), test.get_font_ttx_name ())) as expected_ttx:
expected_file = os.path.join (test_suite.get_output_directory (), test.get_font_ttx_name ())
with open(expected_file, encoding="utf-8") as expected_ttx:
expected_ttx_text = normalize (expected_ttx.read ())
actual_ttx = io.StringIO ()