Skip to content

🐛 fix(discovery): keep preferred venv executable - #218

Merged
gaborbernat merged 2 commits into
tox-dev:mainfrom
gaborbernat:bug/d6c7jueb-venv-preference
Nov 3, 2026
Merged

gaborbernat merged 2 commits into
tox-dev:mainfrom
gaborbernat:bug/d6c7jueb-venv-preference

Conversation

@gaborbernat

@gaborbernat gaborbernat commented Nov 3, 2026 •

Copy link
Copy Markdown
Member

The preferred-path probe resolved each candidate before checking it. For a symlinked virtual environment executable, discovery returned its base interpreter, so commands launched through the returned path used the base prefix. The reproducer in #191 shows the difference. Discovery now retains the preferred executable path. Fixes #191.

Preferred virtual environment

The probe passes the caller's path to the candidate check. The check still uses the resolved target to identify duplicate candidates but returns the absolute invoked path for interrogation. The probe skips a symlink whose target is missing.

Behavior changes

On POSIX, a preferred virtual environment symlink returns the virtual environment executable. On Windows, discovery retains the selected executable path. Discovery continues to skip candidates with missing symlink targets.

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

@gaborbernat gaborbernat added the bug Something isn't working label Nov 3, 2026
@gaborbernat
gaborbernat merged commit e28a4a7 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.

try_first_with loses the selected virtual environment

1 participant