params: support unicode characters (#5363) (#5377)

* params: support unicode characters

* open remove() calls with utf-8

(cherry picked from commit c84833bab1)

Co-authored-by: Batuhan Taskaya <[email protected]>
This commit is contained in:
mergify[bot]
2021-02-01 21:42:13 +02:00
committed by GitHub
co-authored by Batuhan Taskaya
parent 983da1d981
commit befceb55f5
+3 -3
View File
@@ -110,7 +110,7 @@ class FileMixin:
if not self.repo.tree.isfile(self.path):
raise StageFileIsNotDvcFileError(self.path)
with self.repo.tree.open(self.path) as fd:
with self.repo.tree.open(self.path, encoding="utf-8") as fd:
stage_text = fd.read()
d = parse_yaml(stage_text, self.path)
self.validate(d, self.relpath)
@@ -254,7 +254,7 @@ class PipelineFile(FileMixin):
if not self.exists():
return
with open(self.path, "r") as f:
with open(self.path, "r", encoding="utf-8") as f:
d = parse_yaml_for_update(f.read(), self.path)
self.validate(d, self.path)
@@ -310,7 +310,7 @@ class Lockfile(FileMixin):
if not self.exists():
return
with open(self.path) as f:
with open(self.path, encoding="utf-8") as f:
d = parse_yaml_for_update(f.read(), self.path)
self.validate(d, self.path)