Fix encoding issue when loading YAML file (#1316)

related to #1270

Co-authored-by: ccw@cht.com.tw <ccw@cht.com.tw>
Co-authored-by: João Moura <joaomdmoura@gmail.com>
This commit is contained in:
Arthur Chien
2024-09-23 03:50:50 +08:00
committed by GitHub
parent f8169b74f1
commit f7994667e5

View File

@@ -35,7 +35,7 @@ def CrewBase(cls):
@staticmethod
def load_yaml(config_path: Path):
try:
with open(config_path, "r") as file:
with open(config_path, "r", encoding="utf-8") as file:
return yaml.safe_load(file)
except FileNotFoundError:
print(f"File not found: {config_path}")