From 472a4bdaa80319f5fc434a71beddfbcff920c979 Mon Sep 17 00:00:00 2001 From: Haochun Wang Date: Sat, 12 Aug 2023 23:20:25 +0800 Subject: [PATCH] Update prompter.py Add utf-8 encoding for json reader --- utils/prompter.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/prompter.py b/utils/prompter.py index b28b984..3829916 100644 --- a/utils/prompter.py +++ b/utils/prompter.py @@ -18,7 +18,7 @@ class Prompter(object): file_name = osp.join("templates", f"{template_name}.json") if not osp.exists(file_name): raise ValueError(f"Can't read {file_name}") - with open(file_name) as fp: + with open(file_name, encoding='utf-8') as fp: self.template = json.load(fp) if self._verbose: print(