Skip to content

Commit

Permalink
fix: upath read_text encoding fix
Browse files Browse the repository at this point in the history
  • Loading branch information
phil65 committed Nov 1, 2024
1 parent 47e01cf commit 0d3385b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/jinjarope/codetree.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ def parse_object(obj: os.PathLike[str] | str | type) -> Node:
"""
if isinstance(obj, str | os.PathLike):
path = upath.UPath(obj)
content = path.read_text()
content = path.read_text("utf-8")
name = path.name
else:
content = inspect.getsource(obj)
Expand Down
2 changes: 1 addition & 1 deletion src/jinjarope/envglobals.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def load_file_cached(path: str | os.PathLike[str]) -> str:
Arguments:
path: The path to get str content from
"""
return upath.UPath(path).read_text()
return upath.UPath(path).read_text("utf-8")


_cache: dict[str, str] = {}
Expand Down

0 comments on commit 0d3385b

Please sign in to comment.