From 4270643931a2e384929a1af339d45a5221915bf3 Mon Sep 17 00:00:00 2001 From: Jcw87 Date: Sun, 10 Apr 2022 15:59:52 -0700 Subject: [PATCH] tp.py: Explicitly specify utf-8 encoding when opening text files. (#189) --- tools/tp.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/tp.py b/tools/tp.py index d2928f5872e..00c536402d0 100644 --- a/tools/tp.py +++ b/tools/tp.py @@ -696,7 +696,7 @@ def calculate_progress(build_path, matching, format, print_rels): def find_function_range(asm): - with asm.open("r") as file: + with asm.open("r", encoding="utf-8") as file: lines = file.readlines() for line in lines: if line.startswith("/* "): @@ -988,13 +988,13 @@ def find_used_asm_files(non_matching, use_progress_bar=True): task = progress.add_task(f"preprocessing...", total=len(cpp_files)) for cpp_file in cpp_files: - with cpp_file.open("r") as file: + with cpp_file.open("r", encoding="utf-8") as file: includes.update(find_includes(file.readlines(), non_matching)) progress.update(task, advance=1) else: for cpp_file in cpp_files: - with cpp_file.open("r") as file: + with cpp_file.open("r", encoding="utf-8") as file: includes.update(find_includes(file.readlines(), non_matching)) # TODO: NON_MATCHING