From 1ef5b511c4967e7e83695c01997771f5557de698 Mon Sep 17 00:00:00 2001 From: Maximilian Hils Date: Tue, 1 Feb 2022 10:37:41 +0100 Subject: [PATCH] fix `examples/simple.py` Windows compatibility On Windows, the default encoding used by Python sadly is cp1252. We want to force UTF-8 here (as it is the default on macOS/Linux), otherwise the README cannot be read. --- examples/simple.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/simple.py b/examples/simple.py index c3389441a4..becb1326b8 100644 --- a/examples/simple.py +++ b/examples/simple.py @@ -28,7 +28,7 @@ async def on_mount(self, event: events.Mount) -> None: await self.view.dock(body, edge="right") async def get_markdown(filename: str) -> None: - with open(filename, "rt") as fh: + with open(filename, "r", encoding="utf8") as fh: readme = Markdown(fh.read(), hyperlinks=True) await body.update(readme)