Skip to content

Commit 27917bd

Browse files
authored
Merge pull request #5942 from lyovushka/windows-logging
Open log file with utf-8 encoding.
2 parents 176ce63 + 65c1a1c commit 27917bd

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ repos:
2828
hooks:
2929
- id: black
3030
- repo: https://github.com/hadialqattan/pycln # removes unused imports
31-
rev: v2.3.0
31+
rev: v2.5.0
3232
hooks:
3333
- id: pycln
3434
language_version: '3.11'

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
1515
### Fixed
1616

1717
- Fixed `query_one` and `query_exactly_one` not raising documented `WrongType` exception.
18+
- Fixed logging to a file on Windows https://github.com/Textualize/textual/issues/5941
1819

1920
### Changed
2021

src/textual/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ def __call__(self, *args: object, **kwargs) -> None:
9090
)
9191
output = f"{output} {key_values}" if output else key_values
9292

93-
with open(constants.LOG_FILE, "a") as log_file:
93+
with open(constants.LOG_FILE, "a", encoding="utf-8") as log_file:
9494
print(output, file=log_file)
9595

9696
app = self.app

0 commit comments

Comments
 (0)