explicitly set utf8 for Windows (#17664)

This commit is contained in:
Bram Vanroy
2022-06-13 14:05:45 +02:00
committed by GitHub
parent c1daf724ea
commit 73083581a4
3 changed files with 4 additions and 4 deletions

View File

@@ -289,7 +289,7 @@ def retrieve_artifact(name: str):
files = os.listdir(name)
for file in files:
try:
with open(os.path.join(name, file)) as f:
with open(os.path.join(name, file), encoding="utf-8") as f:
_artifact[file.split(".")[0]] = f.read()
except UnicodeDecodeError as e:
raise ValueError(f"Could not open {os.path.join(name, file)}.") from e