Repository navigation
tools/xcl_compare: refuse an --out that names a folder at main start - #5791
Open
evilclanker9000 wants to merge 1 commit into
Open
evilclanker9000 wants to merge 1 commit into
evilclanker9000 wants to merge 1 commit into
Conversation
The report write is the last thing the tool does, after both title runs, so a --out naming an existing folder ended a multi-minute run in an IsADirectoryError traceback. Every other report tool refuses that in main(); do the same here, before either run starts.
|
Tested Both cases pass here, including the Negative control. With so the test does fail before the change and passes after it, and the guard fires before either title runs. The error line carries the plain path, not a repr'd one, so this is clean on the point that broke four other tools on Windows (#5760). AI-assisted. |
Kam471
reviewed
Nov 23, 2026
Kam471
left a comment
Contributor
There was a problem hiding this comment.
Head: 2e86848.
python -I -m pytest tests/test_xcl_compare_out.py -q-> 2 passed.- Manual CLI:
--out <existing folder>-> exit 2, argparse error before either run;--out <missing>/report.jsonand an existing file -> exit 1 atno built XCL(guard not triggered), so only a real folder is refused. - 49 insertions across 2 files; the report write still overwrites an existing file, as before.
Verdict: approve.
This was referenced Nov 23, 2026
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.
tools/xcl_compare.pywrites its report last: after the XCL reference run and the gta6rt run, each a title launch with a 15 s hang timeout and up to eight restarts. A--outthat names an existing folder therefore ended a multi-minute run in a raw traceback:Every other report tool in
tools/refuses that inmain()(anim_index.py,page_index.py,bink_index.py, ...), before the scan or run starts. This does the same, one line plus the message, and adds the test that pins it.Test:
Before the change, with
--outnaming a folder,main()reached the XCL check and the test failed:After the change:
By hand, same command:
No GPU needed: no title runs, no XCL checkout, no game files; the test's
--xclis an empty temp folder.Notes
sys.platformcheck so it answers the same on every platform; the test for a legitimate--outin a missing folder (whichrun_allstill creates) is skipped off Windows because the tool itself is Windows-only.out.parent.mkdir(): the report path is resolved insiderun_all, where the default lives, and the folder case is now refused before that point.--outnaming one of the two transcripts (<work>/xcl_output.txt,<work>/leonida_output.txt) is still not refused; smaller change, and the transcripts are written inside--workunless--outis pointed at one.Item: EGEN-XCL-OUT-FOLDER
AI-assisted.