Skip to content

Commit c24633a

Browse files
authored
Fix encoding Error in windows (#74)
This commit should only fix the ms windows problem, since python use system locale encoding in open() method on ms windows, and use 'utf-8' on most UNIX system. Following https://peps.python.org/pep-0686/
1 parent bed0d0d commit c24633a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ipyvue/Template.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,11 @@ def on_modified(self, event):
4444
def get_template(abs_path):
4545
abs_path = os.path.normpath(abs_path)
4646
if abs_path not in template_registry:
47-
with open(abs_path) as f:
47+
with open(abs_path, encoding="utf-8") as f:
4848
tw = Template(template=f.read())
4949
template_registry[abs_path] = tw
5050
else:
51-
with open(abs_path) as f:
51+
with open(abs_path, encoding="utf-8") as f:
5252
template_registry[abs_path].template = f.read()
5353
return template_registry[abs_path]
5454

0 commit comments

Comments
 (0)