diff --git a/dvc/dvcfile.py b/dvc/dvcfile.py index 37144805b..377f54035 100644 --- a/dvc/dvcfile.py +++ b/dvc/dvcfile.py @@ -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)