Skip to content

Commit 6b47d76

Browse files
aarthy-dkclaude
andcommitted
fix(installer): write log file as UTF-8 so non-ASCII chars don't error
On Windows, `logging.FileHandler` opens the log file with `locale.getpreferredencoding()` when no encoding is passed — cp1252 on a US-English install. Lines containing non-ASCII glyphs like ✓ (used in prereq-status output) hit UnicodeEncodeError on emit; the logging module catches it and prints `--- Logging error ---` plus a traceback to stderr. The install still completes, but the noise is alarming. Add `"encoding": "utf-8"` to the file-handler dictConfig so the file is opened in UTF-8 regardless of locale. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 5f9e827 commit 6b47d76

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

dk-installer.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -684,6 +684,10 @@ def configure_logging(self, debug=False):
684684
"class": "logging.FileHandler",
685685
"filename": str(file_path),
686686
"formatter": "file",
687+
# Default is locale.getpreferredencoding(), which is
688+
# cp1252 on US Windows — chokes on non-ASCII chars like
689+
# ✓ that the installer prints in prereq status lines.
690+
"encoding": "utf-8",
687691
},
688692
"console": {
689693
"level": "DEBUG",

0 commit comments

Comments
 (0)