Skip to content

Commit ca923f7

Browse files
committed
encoding to read demo code
1 parent 71f8ee3 commit ca923f7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/textual/demo/page.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,9 @@ class PageScreen(Screen):
6464

6565
@work(thread=True)
6666
def get_code(self, source_file: str) -> str | None:
67+
"""Read code from disk, or return `None` on error."""
6768
try:
68-
with open(source_file, "rt") as file_:
69+
with open(source_file, "rt", encoding="utf-8") as file_:
6970
return file_.read()
7071
except Exception:
7172
return None

0 commit comments

Comments
 (0)