fix: resolve charmap codec error in wmk analyze and wmk inspect on Windows#200
Merged
Conversation
…ndows Remove legacy_windows=False from StaticAnalyzerConsoleWriter — this flag forces Rich to bypass Win32 console APIs and write through Python IO, which triggers cp1252 UnicodeEncodeError on any non-ASCII character. With the default Console() behaviour (matching wmk perf), Rich uses WriteConsoleW and avoids codec issues entirely. Replace non-ASCII symbols (emoji, check marks, arrows) in console_writer.py, commands/analyze.py, and inspect/formatter.py with ASCII equivalents for the same reason. Closes #191
timenick
reviewed
Apr 1, 2026
timenick
approved these changes
Apr 1, 2026
timenick
added a commit
that referenced
this pull request
Apr 1, 2026
#208) * fix: resolve charmap codec error in winml optimize on Windows Replace non-ASCII characters (→, •) with ASCII equivalents (->, *) in optimize.py to prevent UnicodeEncodeError on Windows cp1252 consoles. This was missed in #200 which applied the same fix to analyze and inspect. Closes #207 * fix: replace remaining non-ASCII chars in build, config, eval, live_chart, perf commands Same charmap codec fix as optimize.py but for the other command files that were missed: build.py, config.py, eval.py, live_chart.py, perf.py.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #191
Root cause (analyze):
StaticAnalyzerConsoleWriterpassedlegacy_windows=FalsetoConsole(). This flag bypasses Rich's Win32WriteConsoleWpath and forces output through Python's IO layer, which on a default Windows console uses cp1252 — a codec that cannot encode any emoji or Unicode check marks.wmk perfand other commands use a plainConsole()with no such flag, which is why they work fine.Root cause (inspect):
inspect/formatter.pyuses✓/✗/○/◇as status icons; these are all outside cp1252 and crash even with the default Console path.Fix:
legacy_windows=False(and the unrelatedforce_terminal=True) fromStaticAnalyzerConsoleWriter— matching the pattern used bywmk perf.analyze/console_writer.py,commands/analyze.py, andinspect/formatter.pywith ASCII equivalents (+/x/!/?/-/*).