From ea55376f137fdb7d808f6099dac9243bb57feddd Mon Sep 17 00:00:00 2001 From: Remy Blank Date: Thu, 12 Sep 2024 20:20:27 +0200 Subject: [PATCH] Fix encoding issues with {exec} :include: on Windows. --- tdoc/common/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tdoc/common/__init__.py b/tdoc/common/__init__.py index 8a4ca67..987d723 100644 --- a/tdoc/common/__init__.py +++ b/tdoc/common/__init__.py @@ -141,8 +141,9 @@ def run(self): for path in include.split(): rel_path, path = self.env.relfn2path(path) self.env.note_dependency(rel_path) + text = pathlib.Path(path).read_text(self.config.source_encoding) content.extend(statemachine.StringList( - initlist=pathlib.Path(path).read_text().splitlines(), + initlist=text.splitlines(), source=path)) self.content[:0] = content res = super().run()