pe_run_package: report a package image that is not a PE as an error line #1608
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1615"
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 R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T15:03:05Z.
pe_run_package.py exits with a traceback when a package image is not a valid PE. pe_package_preflight.py reports the same input as one error line.
Reproduce on origin/main: put a file named app.exe containing the bytes "MZ not a portable executable" in an empty directory and run
python tools/pe_run_package.py MAPPER PACKAGE_DIR app.exe --preflight-only
It prints a Traceback ending in pefile.PEFormatError. main() caught only ValueError and OSError. It now also catches pefile.PEFormatError, the same set the preflight tool uses. The exit code stays 1.
New test: tests/pe_run_package_invalid_check.py (registered as pe_run_package_invalid_pe). It verifies clean exit code 1 with a stderr error line, empty stdout, and no traceback for:
The mapper placeholder is kept outside the package directory so package scanning inspects only the intended package images. The test needs no Windows host, because the error occurs before the mapper is loaded.
Commands executed locally:
Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit
047a3f19e0299310bc9a932f06a7164d1177291a:--preset dev):ctest --preset dev -R '^pe_run_package_invalid_pe$' --parallel 4 --no-tests=error --output-on-failure— 1/1 passed (0.51s)/O2(--preset release):ctest --preset release -R '^pe_run_package_invalid_pe$' --parallel 4 --no-tests=error --output-on-failure— 1/1 passed (0.52s)tests/intake/import_forms_check.pyok (0.1s)AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-24T15:15:59Z.
Codex Review Summary: ✅ Completed
This comment shows the latest Codex review activity on this pull request.
047a3f1ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.