Bug
Several command files under src/winml/modelkit/commands/ crash on Windows with UnicodeEncodeError when printing non-ASCII characters (→, —, •). The default cp1252 encoding on Windows cannot encode these characters.
UnicodeEncodeError: 'charmap' codec can't encode character '\u2192' in position 1: character maps to <undefined>
Root Cause
PR #200 (commit 92325bf) fixed the same class of bug in analyze and inspect, but missed the following files:
optimize.py — → and • in comments and console.print()
build.py — — in comment
config.py — — in string literal (runtime crash)
eval.py — → in comment
live_chart.py — → and — in comments
perf.py — — and → in comments
Fix
Replace → with ->, — with --, and • with * in all affected files, matching the approach in PR #200.
Environment
- Windows 11, Python 3.10.9, cp1252 console encoding
Bug
Several command files under
src/winml/modelkit/commands/crash on Windows withUnicodeEncodeErrorwhen printing non-ASCII characters (→,—,•). The defaultcp1252encoding on Windows cannot encode these characters.Root Cause
PR #200 (commit 92325bf) fixed the same class of bug in
analyzeandinspect, but missed the following files:optimize.py—→and•in comments andconsole.print()build.py——in commentconfig.py——in string literal (runtime crash)eval.py—→in commentlive_chart.py—→and—in commentsperf.py——and→in commentsFix
Replace
→with->,—with--, and•with*in all affected files, matching the approach in PR #200.Environment