Skip to content

system_executable records executable-only symlink instead of real interpreter #84

@gaborbernat

Description

@gaborbernat

When an interpreter is reached through an executable-only symlink (a symlink to the binary sitting in a directory that is not a Python installation), PythonInfo.system_executable keeps the unresolved symlink. Downstream, virtualenv writes home / base-executable in pyvenv.cfg from this value, producing a broken environment for layouts where home must locate the stdlib (python-build-standalone) — see pypa/virtualenv#3157.

CPython is fixing the same problem in venv via python/cpython#115237 (gh-106045): resolve the symlink chain of the executable itself (final path component only, each hop validated with samefile), while keeping a fully symlinked interpreter tree unresolved.

_fast_get_system_executable should mirror that resolution.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions