python: Explicitly specify the encoding when opening files

This commit is contained in:
Eduardo Almeida
2023-05-21 17:31:39 +01:00
parent b20c657523
commit 20ae6fb2d0
12 changed files with 57 additions and 57 deletions

View File

@@ -336,7 +336,7 @@ def create_file(path, template, **kwargs):
artifact_path = Path(path)
#open file for (w)rite and in (t)ext mode
with artifact_path.open("wt") as f:
with artifact_path.open("wt", encoding="utf-8") as f:
f.write(template.format(**kwargs))