From befceb55f5bcf0d5aaccdf8cdb411e504628337b Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Mon, 1 Feb 2021 21:42:13 +0200 Subject: [PATCH] params: support unicode characters (#5363) (#5377) * params: support unicode characters * open remove() calls with utf-8 (cherry picked from commit c84833bab1d81dfdf9d89157b2ce41ae085f3781) Co-authored-by: Batuhan Taskaya --- dvc/dvcfile.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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)