We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 71f8ee3 commit ca923f7Copy full SHA for ca923f7
src/textual/demo/page.py
@@ -64,8 +64,9 @@ class PageScreen(Screen):
64
65
@work(thread=True)
66
def get_code(self, source_file: str) -> str | None:
67
+ """Read code from disk, or return `None` on error."""
68
try:
- with open(source_file, "rt") as file_:
69
+ with open(source_file, "rt", encoding="utf-8") as file_:
70
return file_.read()
71
except Exception:
72
return None
0 commit comments