Repository navigation
fix: honor PEP 514 executable arguments during discovery - #148
Merged
gaborbernat merged 4 commits intoOct 16, 2026
Merged
Conversation
Pass ExecutableArguments through the existing query path instead of a parallel one: one Popen call that takes a raw command line when arguments are present, and the arguments stored in the disk cache entry metadata rather than a separate DiskCache store reached through getattr. The metadata key is always written, so a plain query of a launcher no longer reads an entry written for the same launcher with arguments, which the previous optional key allowed for caches without the private method. Drop the unreachable non-Windows guard and the registry helper that returned a validity flag, and move the argument tests to their own file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

PEP 514
ExecutableArgumentsare read from the registry but discarded before interpreter interrogation. A registration pointing topy.exewith-3.11is consequently queried as the launcher's default runtime and can be omitted from Python 3.11 discovery.Carry the raw Windows argument fragment before the quoted collector arguments without invoking a shell. Include arguments in memory/disk cache identity, normalize blank values, and retain the collected child executable for argument-bearing launcher queries so the returned path launches the selected runtime. The ordinary public no-argument API is unchanged. Add registry, quoting, cache and real-launcher regressions.
Validation on Windows: 51 focused tests passed, 8 skipped, one known baseline fixture failure deselected; the real
py.exe -3.11test passed independently and executed the returned Python binary. Ruff, formatting, docs and package-metadata checks pass. A full same-base comparison produced the identical 34 failing test IDs on both trees, with eight additional passes in the candidate. Both configured type targets likewise match the clean base's 13 existing diagnostics, with no candidate-only findings. Those unrelated baseline failures remain unchanged.The argument ordering follows PEP 514.
Hosted runtime suites passed (611–613 tests each) but exposed missing coverage for the new argument-query branches on Linux. Added five cross-platform contract tests for cache identity/fallback, non-Windows rejection, selected executable preservation, and raw Popen command construction. The local focused module passes 29 tests with 8 Windows-inapplicable skips; independent review and Ruff pass. The new hosted run is pending.