fix(tools): wrap entrypoint in main with stream reconfigure in pad_input #10206
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/10206"
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 emirplus on 2026-10-23T13:32:31Z.
What
Wrap the
tools/pad_input.pyentrypoint inmain(argv=None), reconfigure stdout/stderr to UTF-8 withbackslashreplaceerror handling, and return 0 on success (sys.exit(main())). Adds tests for explicit argv and for the stream reconfiguration.Tested
python3 tools/tests/test_pad_input.py: 12 passed (MarcZX10 on this head).pr_overlap_encoding, also fails on main), 6 skip (babyhuey).Checklist
main; no other open PR implements the same functionsNotImplemented_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)Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-23T14:01:42Z.
Review: CHANGES_REQUESTED
I ran the focused test file on this exact head:
python3 tools/tests/test_pad_input.pypassed (12 tests). The diff is small andgit diff --checkis clean.The required repository conventions check currently fails because the PR description contains only a one-sentence summary and omits the required
What,Tested, andChecklistsections. Please fill those sections with the intended behavior, actual tests run, and applicable checklist items, then rerun conventions.There is also a concrete integration overlap with #6531: a pairwise
git merge-treepreview reports conflicts in bothtools/pad_input.pyandtools/tests/test_pad_input.py. #6531 changes directory/path validation and error handling; this PR adds entry-point/stream handling. Please coordinate the merge order with that PR’s author, record a dependency if one needs to land first, and preserve both changes in a combined rebase. No closure is requested.Imported from boykopovar/AnyPS5. Originally posted by THEMANnt on 2026-10-29T06:19:24Z.
Review: COMMENTED
Reviewed
70da4aae77e49685cc4f1f64f119f8c48169abafagainst938812df1403f9616dba71744216725891ca4979.The explicit-argv entrypoint preserves the controller-command writer and reports success through main's return value. Both streams use UTF-8/backslashreplace, including filenames that cannot be printed with strict Unicode handling. No actionable finding in this scoped change.
Windows/Python 3.11: head 14 passed/2 POSIX skips; baseline 12 passed/2 skips. The new explicit-argv tests fail against the old entrypoint signature; that is API-coverage evidence, not proof of an old CLI failure. Independent actual CLI subprocesses write a cross-button command to Unicode/surrogate filenames and exit 0 on both arms under an ASCII/backslashreplace output default. No controller or title was run.
Publication-time checks: merge conflict with main. Please complete these checks before final approval; this status alone is not a demonstrated implementation defect.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-22T07:58:53Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks this change; the reviewed code supports merging.
What I ran
Reviewed head
70345a51a24958b92f97f119123464c2b9a261bc. No commands or tests were run.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
The test suite and runtime behavior were not independently verified. The author reports 12 tests passed on this head and selected Windows tests passed on a merged preview. Both changed files listed in the manifest were read; no files were excluded by the manifest.
To get this to a good state
Nothing is required.