Skip to content

Commit

Permalink
fix: always open script file with utf8 encoding.
Browse files Browse the repository at this point in the history
Fixes #159
  • Loading branch information
maartenbreddels committed Jun 20, 2023
1 parent 486754a commit a820617
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion solara/autorouting.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def source_to_module(path: Path, initial_namespace={}) -> ModuleType:
mod.__file__ = str(path)
mod.__dict__.update(initial_namespace)
if path.suffix == ".py":
with open(path) as f:
with open(path, encoding="utf8") as f:
ast = compile(f.read(), path, "exec")
exec(ast, mod.__dict__)
elif path.suffix == ".ipynb":
Expand Down

0 comments on commit a820617

Please sign in to comment.