Skip to content

Commit 1ef5b51

Browse files
authored
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.
1 parent cfefb36 commit 1ef5b51

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

examples/simple.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ async def on_mount(self, event: events.Mount) -> None:
2828
await self.view.dock(body, edge="right")
2929

3030
async def get_markdown(filename: str) -> None:
31-
with open(filename, "rt") as fh:
31+
with open(filename, "r", encoding="utf8") as fh:
3232
readme = Markdown(fh.read(), hyperlinks=True)
3333
await body.update(readme)
3434

0 commit comments

Comments
 (0)