diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 009c06616..9c56963d8 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -28,7 +28,7 @@ repos: hooks: - id: black - repo: https://github.com/hadialqattan/pycln # removes unused imports - rev: v2.3.0 + rev: v2.5.0 hooks: - id: pycln language_version: '3.11' diff --git a/CHANGELOG.md b/CHANGELOG.md index 99d93ccc0..dff82a50d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). +## Unreleased + +### Fixed + +- Fixed logging to a file on Windows https://github.com/Textualize/textual/issues/5941 + ## [3.7.1] - 2025-07-09 ### Fixed diff --git a/src/textual/__init__.py b/src/textual/__init__.py index f0b587248..65f917cff 100644 --- a/src/textual/__init__.py +++ b/src/textual/__init__.py @@ -90,7 +90,7 @@ class Logger: ) output = f"{output} {key_values}" if output else key_values - with open(constants.LOG_FILE, "a") as log_file: + with open(constants.LOG_FILE, "a", encoding="utf-8") as log_file: print(output, file=log_file) app = self.app