script: report path replay failures without a traceback #1593
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1600"
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?
Imported from R0Y00/Xbox2Windows. Originally posted by RenzoWit35 on 2026-11-24T14:45:45Z.
Change
In
tools/script_path_replay.pyonlyselect_treewas inside thetrythat turnsOSErrorandValueErrorinto<archive>: <message>with exit code 1. Thereplay(...)call was outside it, so its input errors ended in a raw traceback:ValueError("Expected one root states container"), the state-label errors, and theOSError(FileNotFoundError) fromctypes.CDLLfor a missing--hostlibrary.replay(...)call is now wrapped in the sameexcept (OSError, ValueError)handler and reportsparser.exit(1, f"{args.archive}: {exc}\n"). The JSON is printed only afterreplaysucceeds, so stdout stays empty on failure.<archive>:prefix for the missing-host case too. The message from the loader names the missing module itself (Could not find module '<host path>' ...), so the cause stays clear.replay()is not restructured.Verification
Environment: Windows 11, Python 3.14.5,
origin/mainata3ac47a9. Pure Python, nothing built.Before (
origin/main):python -B tools/script_path_replay.py replay.bin --host nohost.dll --record-with synthetic_orbit a//b, wherereplay.binisfixture(priorities=(9, 8))fromtests/script_state_check.py: exit 1, stdout empty, stderr ends with a full traceback andValueError: Expected one root states container. Callingreplay()directly on the fixture oftests/script_path_check.pywith a nonexistent host path raisedFileNotFoundError: Could not find module '...nohost.dll' (or one of its dependencies)....After (same command): exit 1, stdout empty, stderr is one line:
<dir>\replay.bin: Expected one root states container.New test
test_replay_failure_is_reported_without_a_tracebackinCommandLineTests(tests/script_state_check.py) runs that command throughrun_tooland asserts exit code 1, the archive name andExpected one root states containerin stderr, noTraceback, and empty stdout.out/pe-env/Scripts/python.exe -B tests/script_state_check.py:Ran 16 tests ... OK.out/pe-env/Scripts/python.exe -B tests/bidi_controls_check.py:Self-test passed.and no bidirectional controls in 1233 files.tools/script_path_replay.pyrestored toorigin/main, the same command givesFAILED (failures=1):AssertionError: 'replay.bin' not found in 'Traceback (most recent call last): ... ValueError: Expected one root states container'. With the fix restored it passes.Rebased onto
origin/mainata3ac47a9before opening this pull request and re-run there:tests/script_state_check.pyran 16 tests, OK;tests/docs_links_check.pypassed (16 Markdown files, 347 links);tests/bidi_controls_check.pypassed (1259 files, no bidirectional controls); withtools/script_path_replay.pyrestored toorigin/mainthe new test fails.Not run: the missing-host (
OSError) path is not covered by a test. Reachingctypes.CDLLneeds an archive with a rootstatescontainer, and the fixture builder intests/script_state_check.pycannot produce one; the fixture intests/script_path_check.pyreturns an in-memory tree, not an archive. I only observed that path by callingreplay()directly, before the change.tests/script_path_check.pywas not run: it takes the built host DLL as an argument (tools/script_path_host.cpp), and no build was done. The test is already registered inAGENTS.md, the workflow and CMake.Evidence and follow-up
Checked again after the rebase: no open upstream PR touches
tools/script_path_replay.py,tests/script_state_check.pyortests/script_path_check.py. No issue is linked.AI-assisted.