fix(tools): report controller command file errors cleanly #11360
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/11360"
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 boykopovar/AnyPS5. Originally posted by arcwiser on 2026-10-26T08:23:33Z.
What
Catch file I/O errors throughout controller command sequencing, temporary-file creation and atomic replacement in
pad_input.py, reporting an argparse error instead of an uncaught traceback. Preserve the existing command and temporary-file cleanup on failure.Draft because #6531 and its rebased follow-up #11312 overlap the missing-parent-directory symptom and modifies the same CLI function. This change additionally handles read, temporary-file and replacement failures; coordination is needed before marking it ready. #10206 and #10578 modify other behavior in the same tool.
Tested
Windows, Python 3.12, upstream base
204c6747d0a1cbaf932def3dea0778810cc3935e; published head12a121f13ad4f80367e01a30e69a1aa65051486b.python -m unittest discover -s tools/tests -p 'test_pad_*.py': 31 passed, 3 POSIX-only skips.python tools/check_conventions.py --base origin/main: passed.git diff --check origin/main HEAD: passed.python tools/pr_overlap.py --branch fix/pad-input-io-errors --repo boykopovar/AnyPS5: completed successfully. Conflicting hunks: #10206 intools/tests/test_pad_input.py; #11312 intools/pad_input.pyandtools/tests/test_pad_input.py. #6531 conflicts with main, preventing automatic comparison; its shared files were inspected manually.No game, GPU, POSIX runtime or C++ build tested. Base freshness and overlap coordination remain to be resolved before ready-for-review.
Checklist
main; no other open PR implements the same functions (base recorded above; partial overlap #6531/#11312 and shared-file conflict #10206 require coordination)NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)Overlap details
#11312 rebases #6531's path validation and output encoding changes and adds a read-permission regression expecting the raw exception. This branch instead reports read, temporary-file and replacement errors through argparse and tests all three failure stages. Combining the branches requires retaining its path/encoding changes, this broader error handling, and reconciling the differing unreadable-file test expectation. #10206 adds stream/entry-point changes and tests at the same insertion point. This draft is not ready to merge until the ordering and shared tests are coordinated. No dependencies declared yet.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-17T08:59:05Z.
Review: COMMENTED
Reviewed — no blocking findings
Nothing blocks this; the points below are optional, and no approval is given while the PR is a draft.
What I ran
12a121f13ad4f80367e01a30e69a1aa65051486b, basemain. Merged-preview check: not run.tools/pad_input.pyat head (lines 1-112) andtools/tests/test_pad_input.pyat head (lines 1-40), plus the changed test hunk from the diff.Commands
The
searchcall returned no matches, so I did not rely on it.Results
pad_input.pyat headFindings
Blocking
None.
Non-blocking
None verified.
Not verified
tools/tests/test_pad_input.py:142asserts"No such file or directory"in stderr. That is the POSIX wording of the OS error. The description says the suite passed on Windows, where the wording may differ. I could not check this.tools/tests/test_pad_input.pylines 41-162 at head were not read. Only the changed hunk (lines 136-159) was checked.main" is unchecked in the description.To get this to a good state
Nothing is required.
Optional:
Sources
tools/pad_input.pylines 20-25:previous_sequencecatches onlyFileNotFoundError, so other read errors reach the new handler at line 106.tools/pad_input.pylines 85-107: the outertryandexcept (OSError, ValueError), with the cleanup in thefinallykept.Imported from boykopovar/AnyPS5. Originally posted by ligmaSec on 2026-12-03T17:01:03Z.
Review: COMMENTED
The exact controller-command Python suite passed 15 cases on Linux with one skip. It covers the missing parent directory and failed open or replace while preserving the previous command. Current main conflicts in both the tool and the test suite. Keep the newer touch fields and existing
replace_commandretry path when applying this error handling.AI-assisted: yes.
Pull request closed