Skip to content

🐛 fix(discovery): accept literal PATH symlinks - #220

Merged
gaborbernat merged 2 commits into
tox-dev:mainfrom
gaborbernat:bug/9225hchj-literal-symlink
Nov 3, 2026
Merged

gaborbernat merged 2 commits into
tox-dev:mainfrom
gaborbernat:bug/9225hchj-literal-symlink

Conversation

@gaborbernat

Copy link
Copy Markdown
Member

A literal interpreter name could miss a symlink on PATH. PythonInfo._satisfies_path compared the request with the resolved system executable's name, so discovery could skip the executable found under the requested name. It now compares the candidate's executable name. Fixes #188.

Literal names after interpreter resolution

resolve_to_system can replace original_executable while retaining the candidate path in executable. The name check now uses that retained path.

Behavior changes

Literal names now accept matching symlinks on PATH. Absolute paths and version constraints keep their existing checks. On Windows, the comparison still removes the .exe suffix.

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

Resolving a Python symlink can replace its recorded original executable with
the system binary. Match the executable found on PATH so a literal lookup
keeps the symlink name.
Windows needs the standalone Python directory on PATH when starting a
temporary executable symlink. Keep that directory after the symlink's parent
so the test reaches name matching.
@gaborbernat gaborbernat added the bug Something isn't working label Nov 3, 2026
@gaborbernat
gaborbernat merged commit 690fcbf into tox-dev:main Nov 3, 2026
21 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.

Literal executable names miss symlinks on PATH

1 participant