Skip to content

🐛 fix(probe): preserve supplied environment - #225

Merged
gaborbernat merged 2 commits into
tox-dev:mainfrom
gaborbernat:bug/hal1epea-base-env
Nov 3, 2026
Merged

gaborbernat merged 2 commits into
tox-dev:mainfrom
gaborbernat:bug/hal1epea-base-env

Conversation

@gaborbernat

@gaborbernat gaborbernat commented Nov 3, 2026 •

Copy link
Copy Markdown
Member

PythonInfo._from_exe_with_args() passed the caller's env to the first interpreter probe but dropped it during base resolution. For a virtual environment, the returned metadata could reflect the process environment, and a follow-up probe could use a different timeout. Follow-up probes now receive the supplied mapping. Fixes #193.

Base interpreter probes

resolve_to_system() called the prefix and system-executable probes without env. Python's subprocess API uses an explicit mapping in place of the process environment, so those probes could observe different values from the first one. The caller now passes the mapping into resolution, which forwards it to both follow-up paths.

Behavior changes

On POSIX and Windows, a follow-up probe issued while resolving a virtual environment uses the supplied environment, including PY_DISCOVERY_TIMEOUT. Calls without env continue to use the process environment. Direct callers of resolve_to_system() can now pass an environment mapping.

Reported by Anthropic's OSS Scanner: ANT-2026-HAL1EPEA.

@gaborbernat gaborbernat added the bug Something isn't working label Nov 3, 2026
@gaborbernat
gaborbernat force-pushed the bug/hal1epea-base-env branch from 2ed6772 to 4d069c8 Compare November 3, 2026 01:42
@gaborbernat
gaborbernat enabled auto-merge (squash) November 3, 2026 02:05
@gaborbernat
gaborbernat merged commit 9db16f6 into tox-dev:main Nov 3, 2026
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Base-interpreter probes ignore the supplied environment

1 participant