Repository navigation
awc_shorts: name a missing source as typed, not through repr() (EGEN-AWC-SHORTS-PATHREPR) - #6647
Conversation
The one ERROR line for a missing input ran the path through !r, so every backslash was doubled on Windows (C:\\\\Users\\\\...) and the path could not be pasted back. The --out line beside it already prints its path as typed, and so do the other tools whose messages were fixed the same way (ItsNotRexed#5927).
Fails on Windows before the fix in the parent commit (repr() turns C:\\a\\b into C:\\\\a\\\\b, so the plain path is not a substring); passes after it, and on Linux both ways since the path has no backslash there.
LAKSHYA-cmd-tech
left a comment
There was a problem hiding this comment.
Independent review on Windows 11 x64, Python 3.12.
- Red-first verification on Windows: On parent revision with
!r,missinginawc_shorts: error: source does not exist:contains doubled backslashes (\\), failingtest_missing_source_names_the_path_as_typed. On head without!r, the path matches as typed. python -I -m compileall -q tools/awc_shorts.py tests/test_awc_shorts.py(exit 0)python -I tests/test_awc_shorts.py(14/14 passed)python -I tools/awc_shorts.py --help(exit 0)python -I scripts/check_no_game_data.py(exit 0)git diff --checkclean (0).
LGTM. AI-assisted; synthetic tests only, no game files or GPU used.
|
Tested 58df695 merged with main 8575d36 on Windows/Python 3.13.1 and Linux/Python 3.12.16: pass Merge was clean (tools/awc_shorts.py, tests/test_awc_shorts.py). Windows, 3.13.1 (worktree of main with the PR merged):
Linux, 3.12.16:
Diff read: one change, |
shayderrr
left a comment
There was a problem hiding this comment.
Summary
tools/awc_shorts.py::main now prints a missing source as {a.src} rather than {a.src!r}, so Windows paths keep single backslashes and can be pasted back into a shell; test_missing_source_names_the_path_as_typed asserts the message.
Why merge
The repr() form doubled backslashes and disagreed with the neighboring --out error line. Focused message fix matching the style used by earlier tool cleanups.
Verdict: Approve
|
Summary Why merge Verdict: Approve |
…6647 and keep lazy AWC dir creation
tools/awc_shorts.pyrefuses a missingsourcewith one line, but that line ran the path through!r.repr()doubles every backslash, so on Windows the message waswhich cannot be pasted back into a shell, and it disagrees with the
--outline nine lines below it (cannot create {a.out}), which already prints its path as typed. The other tools whose messages were fixed for the same reason are #5927.What changed
tools/awc_shorts.py: the missing-source line prints{a.src}, not{a.src!r}.tests/test_awc_shorts.py: a test that the path as built by the test (an absolute path inside a temporary folder) appears in the one stderr line.Test
daf572c66~1, file restored withgit checkout):FAIL: test_missing_source_names_the_path_as_typed,Ran 14 tests,FAILED (failures=1), exit 1.Ran 14 tests,OK, exit 0.Reproduction with the CLI, before and after:
The test bites on Windows only (the path has no backslash on Linux), which is where the doubled backslashes appeared; it passes on Linux both ways.
No GPU and no game files: the test builds its bank in the fixture, and the reproduction only names a path that does not exist.
Notes
'{a.src}'by hand, to match the--outline in the same function and the browser-side style of tools: print a refused or unreadable path as typed, not through repr() (5 tests fail on Windows) #5927.docs/awc_shorts.mddoes not quote this error line, and docs/awc_shorts: a repeated stream id is written as <id>~2.ogg, not overwritten #5648 already has that page open.EGEN-AWC-SHORTS-PATHREPR
AI-assisted.