Scripts: harden pe_exports CLI argument handling, validation, and test coverage #1804
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1814"
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 ivall/xcl. Originally posted by heditrigui on 2026-11-24T21:04:16Z.
Summary
Hardens CLI argument handling and validation in
scripts/re/pe_exports.pyand expands unit test coverage inscripts/test_pe_exports.py:-hand--helpCLI option support with usage docstrings and clean exit code 0.error: file not found: '<path>'on stderr and exits code 1) instead of crashing with unhandled Python exceptions.parse_exports(bytes)anddump_pe_exports(path)functions.scripts/test_pe_exports.pyfrom 1 to 8 tests covering CLI argument flags, exit codes, missing files, invalid PE binaries, and direct Python API parsing across both 32-bit (PE32) and 64-bit (PE32+) binaries.Tested
python -m unittest scripts/test_pe_exports.py(8 passed in 0.40s).python -m pytest scripts/(23 passed in 0.78s).scripts/pr_check.py --local.Not tested
scripts/tools are non-runtime code).AI use
Imported from ivall/xcl. Originally posted by futurepro62 on 2026-11-24T21:14:43Z.
Tested exact head
0180bf4, script tests only, since this PR has no test report yet.Tested
python -m pytest scripts/test_pe_exports.pyat the head: 8 passed, 2 subtests passed.266b845): does not get to run: collection fails withFileNotFoundError: ... '-q', because main'spe_exports.pyreadssys.argv[1:]at import time (which this PR changes).Not tested
AI use
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T00:28:11Z.
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~23 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.)Thanks!
Imported from ivall/xcl. Originally posted by github-actions[bot] on 2026-11-28T08:01:08Z.
Nothing has happened on this PR for 3 days, so it is marked
staleand will be closed in 4 days. A push or a comment takes the mark off: rebase it ontomainif it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T06:52:23Z.
Triage (#1607) – head
0180bf4Three open PRs fix specific cases in the same script, and this one does not include any of their fixes: #1494 (NumberOfRvaAndSizes), #1685 (export data in the image headers) and #2662 (map RVAs only to file-backed bytes; this PR still maps through
max(VirtualSize, SizeOfRawData)). Its full rewrite of scripts/re/pe_exports.py will conflict with each of them. The quote-style change across the whole file is unrelated churn that makes the diff larger. No functional problems found.Recommendation: keep open.
AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.