tooling: write dependency_paths JSON as ASCII #635
No reviewers
Labels
No labels
accessibility
awaiting author
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
priority: P0
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/R0Y00--Xbox2Windows!635
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/635/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@louisdibiasi on GitHub · 2026-11-22 16:55 UTC · original
louisdibiasi:tooling/dependency-paths-ascii-json→main· +24 −2 · 2 files · 1 commits · merged 2026-11-22 17:15 UTCChange
tools/dependency_paths.pyprinted its report withensure_ascii=False. With a narrow stdout code page, an image name outside that page made the tool exit withUnicodeEncodeError. In the documented PowerShell pipeline (dependency_paths.py ... | Set-Content -Encoding utf8, docs/experiments.md "dependency_paths" section) the same input exited 0 and wrote a different character instead of the original. The default JSON escapes decode to the same names and do not depend on the console encoding, so the change dropsensure_ascii=False.Independent problem, no linked issue.
Verification
Commit under test:
b41c44eon1947e97, Windows 11, Python 3.12.10.Base, narrow stdout:
PYTHONIOENCODING=cp1252 python -B tools/dependency_paths.py inventory.json(imagepkg/Ωmega.dll)->
UnicodeEncodeError: 'charmap' codec can't encode character 'Ω', exit 1.Base, documented pipeline, image
pkg/café.dll, Windows PowerShell withRemove-Item Env:PYTHONUTF8:python -B tools/dependency_paths.py inventory.json | Set-Content out.json -Encoding utf8-> exit 0,out.jsoncontains"pkg/cafΘ.dll".With this change the same pipeline writes
"pkg/café.dll", andjson.loadsreturns the original name.New check in
tests/dependency_paths_check.py(dependency_paths_controlsin CTest): runs the CLI withPYTHONIOENCODING=cp1252on an inventory containing U+03A9 and requires exit 0 and the name in the parsed output.python -B tests/dependency_paths_check.py-> UnicodeEncodeError, exit 1.Evidence and follow-up
Synthetic inventory only, no game files. Not run: Linux or macOS (the cp1252 case uses
PYTHONIOENCODING, so it does not need a Windows code page). The report text is otherwise unchanged; only non-ASCII characters are now escaped.Checklist
AI-assisted: I used Claude to find the bug and draft the change. I ran the reproductions and tests above myself.