Skip to content

Commit

Permalink
Fix Pathlib read_text() encoding in build_script_generator module
Browse files Browse the repository at this point in the history
  • Loading branch information
rleh committed Sep 5, 2020
1 parent e26316c commit 2d72625
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tools/build_script_generator/module.lb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class BuildModuleDocs:

def __str__(self):
if self._content is None:
self._content = Path(localpath("module.md")).read_text().strip()
self._content = Path(localpath("module.md")).read_text(encoding="utf-8").strip()
tools = ["avrdude", "openocd", "bmp", "gdb", "size",
"unittest", "log", "build_id", "bitmap"]

Expand All @@ -32,7 +32,7 @@ class BuildModuleDocs:
doc = None
# Documentation is inside a Markdown file
if tpath.with_suffix(".md").exists():
doc = tpath.with_suffix(".md").read_text()
doc = tpath.with_suffix(".md").read_text(encoding="utf-8")
# Documentation is inside the tool as a docstring
elif tpath.exists():
doc = re.search('"""(.*?)"""', tpath.read_text(), flags=re.DOTALL | re.MULTILINE)
Expand Down

0 comments on commit 2d72625

Please sign in to comment.