From f2231193815a1fd8dc6860055f5995e91eaa4dbd Mon Sep 17 00:00:00 2001 From: Floris van Doorn Date: Sun, 30 Jun 2024 18:14:52 +0200 Subject: [PATCH] encoding --- leanblueprint/Packages/blueprint.py | 4 ++-- leanblueprint/client.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/leanblueprint/Packages/blueprint.py b/leanblueprint/Packages/blueprint.py index ba3a99e..b405463 100644 --- a/leanblueprint/Packages/blueprint.py +++ b/leanblueprint/Packages/blueprint.py @@ -233,7 +233,7 @@ def make_lean_data() -> None: n) == 'definition' for n in graph.ancestors(node).union({node})) lean_decls_path = Path(document.userdata['working-dir']).parent/"lean_decls" - lean_decls_path.write_text("\n".join(document.userdata.get("lean_decls", []))) + lean_decls_path.write_text("\n".join(document.userdata.get("lean_decls", [])), encoding="utf-8") document.addPostParseCallbacks(150, make_lean_data) @@ -293,7 +293,7 @@ def make_legend() -> None: """ Extend the dependency graph legend defined by the depgraph plugin by adding information specific to Lean blueprints. This is registered - as a post-parse callback to allow users to redefine colors and their + as a post-parse callback to allow users to redefine colors and their descriptions. """ document.userdata['dep_graph']['legend'].extend([ diff --git a/leanblueprint/client.py b/leanblueprint/client.py index 71adb21..7f0e4c0 100644 --- a/leanblueprint/client.py +++ b/leanblueprint/client.py @@ -116,7 +116,7 @@ def parse_libs(self) -> List[str]: def add_checkdecls(self) -> None: """see `super.add_checkdecls`""" - with self.path.open("a") as lf: + with self.path.open("a", encoding="utf-8") as lf: lf.write('\nrequire checkdecls from git "https://github.com/PatrickMassot/checkdecls.git"') def add_docgen(self) -> None: @@ -440,7 +440,7 @@ def mk_pdf() -> None: bbl_path = blueprint_root/"print"/"print.bbl" if bbl_path.exists(): shutil.copy(bbl_path, blueprint_root/"src"/"web.bbl") - + @cli.command() def pdf() -> None: """