mirror of https://github.com/zeldaret/tp.git
tp.py: Explicitly specify utf-8 encoding when opening text files. (#189)
This commit is contained in:
parent
545da8536d
commit
4270643931
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue