Skip to content

analyze_4240_full: a folder input is one error line, not a traceback - #1399

Merged
ItsNotRexed merged 1 commit into
ItsNotRexed:mainfrom
bobcatchris:fix/analyze-4240-dir-input
Nov 22, 2026
Merged

ItsNotRexed merged 1 commit into
ItsNotRexed:mainfrom
bobcatchris:fix/analyze-4240-dir-input

Conversation

@bobcatchris

Copy link
Copy Markdown
Contributor

main() checks each positional with os.path.exists(), so a folder counts as an archive. process_archive() then opens it and Windows raises PermissionError, POSIX IsADirectoryError — a raw traceback, and because the loop never reaches the next path, a mistyped first argument loses the results of every archive after it:

$ python -I tools/analyze_4240_full.py <work>/carve good.rpf
Traceback (most recent call last):
  ...
PermissionError: [Errno 13] Permission denied: '...\\carve'

Found by running each tool's positional against a directory, an empty file and a missing path; this was the only traceback in the sweep.

Change

A non-file input is one ERROR: line and status = 1, the same way the existing "does not exist" branch already behaves, so the run continues with the remaining archives.

Checks

  • python -m pytest tests/test_analyze_4240_full.py -q → 6 passed (new test: folder first, valid archive second, exit 1, no traceback, Processing <good> still printed).
  • Negative control: the new test fails against f85582e2's tool (PermissionError traceback, Processing never printed).
  • ruff check on both files: 3 findings, unchanged.

Synthetic archives only.

AI-assisted.

`main()` gated each positional on `exists()`, so a folder counted as an RPF9
archive; `process_archive()` opened it and raised PermissionError (Windows) or
IsADirectoryError (POSIX), which also ended the run before the remaining
archives were read. A non-file input now prints one ERROR line and sets the
non-zero status, like the existing "does not exist" branch, so the rest of the
command line still runs.
@kapitche

Copy link
Copy Markdown
Contributor

Tested on Linux (WSL2 Ubuntu), Python 3.12, CPU only: pass. Tests with main merged: 6 passed. With tools/analyze_4240_full.py from main, 1 fails.

@ItsNotRexed
ItsNotRexed merged commit db33048 into ItsNotRexed:main Nov 22, 2026
9 of 10 checks passed
@bobcatchris

Copy link
Copy Markdown
Contributor Author

For the record on the one red job: windows failed in d3d12_present (test 61) with

line 139: d.create(true)

That was not this branch. main's c2967a5e ("Register d3d12_present_test with ctest") registered the test with SKIP_RETURN_CODE 77 while it still began with EXPECT(d.create(true)), so on a runner with no presentation-capable Vulkan device it failed instead of skipping. #908 (de47dbd0, merged 11:25:26Z, after this run) turns that into if (!d.create(true)) return 77;.

Reproduced locally on bb2e1842 with the ICD list pointed at a nonexistent file, which is the runner's situation: the test prints no Vulkan device with presentation, skipped, exits 77, and ctest reports 62 - d3d12_present (Skipped) rather than a failure.

The rest of the run is green: check, linux-gpu-tools, change-scope, no-game-data, translator-tests, viewer-tests and both semantic-tests legs; the wine matrix gate skipped because the change is Python-only.

AI-assisted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants