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.
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_executablekeeps the unresolved symlink. Downstream, virtualenv writeshome/base-executableinpyvenv.cfgfrom this value, producing a broken environment for layouts wherehomemust locate the stdlib (python-build-standalone) — see pypa/virtualenv#3157.CPython is fixing the same problem in
venvvia python/cpython#115237 (gh-106045): resolve the symlink chain of the executable itself (final path component only, each hop validated withsamefile), while keeping a fully symlinked interpreter tree unresolved._fast_get_system_executableshould mirror that resolution.