Skip to content

Commit 421a3cf

Browse files
authored
Merge pull request Textualize#5182 from Textualize/fix-encoding
fix encoding on Windows
2 parents 37eaf23 + 9023859 commit 421a3cf

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](http://keepachangelog.com/)
66
and this project adheres to [Semantic Versioning](http://semver.org/).
77

8+
## [0.85.1] - 2024-10-26
9+
10+
### Fixed
11+
12+
- Fixed encoding issue when saving files such as screenshots on Windows
13+
814
## [0.85.0] - 2024-10-25
915

1016
### Changed
@@ -2483,6 +2489,7 @@ https://textual.textualize.io/blog/2022/11/08/version-040/#version-040
24832489
- New handler system for messages that doesn't require inheritance
24842490
- Improved traceback handling
24852491

2492+
[0.85.1]: https://github.com/Textualize/textual/compare/v0.85.0...v0.85.1
24862493
[0.85.0]: https://github.com/Textualize/textual/compare/v0.84.0...v0.85.0
24872494
[0.84.0]: https://github.com/Textualize/textual/compare/v0.83.0...v0.84.0
24882495
[0.83.0]: https://github.com/Textualize/textual/compare/v0.82.0...v0.83.0

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "textual"
3-
version = "0.85.0"
3+
version = "0.85.1"
44
homepage = "https://github.com/Textualize/textual"
55
repository = "https://github.com/Textualize/textual"
66
documentation = "https://textual.textualize.io/"

src/textual/driver.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,9 @@ def deliver_binary(
240240

241241
def save_file_thread(binary: BinaryIO | TextIO, mode: str) -> None:
242242
try:
243-
with open(save_path, mode) as destination_file:
243+
with open(
244+
save_path, mode, encoding=encoding or "utf-8"
245+
) as destination_file:
244246
read = binary.read
245247
write = destination_file.write
246248
chunk_size = 1024 * 64

0 commit comments

Comments
 (0)