The executable symlink resolution from #84 follows every symlink hop. For Homebrew pythons this resolves /opt/homebrew/bin/python3.12 through the version-pinned Cellar/python@3.12/<version> path, recording a home that breaks on brew upgrade and changes the alias under which the base site-packages appears in created environments (caught by pypa/virtualenv CI on the brew@3.12/brew@3.13 jobs). It also needlessly rewrites stable aliases like Debian's /usr/bin/python3.
Real getpath only follows the executable symlink while the stdlib landmark is missing next to it. Mirror that: stop resolving once <dir>/../lib(64)/pythonX.Y/os.py is reachable, and skip resolution entirely for macOS framework builds, which self-locate through the real binary via dyld at runtime.
The executable symlink resolution from #84 follows every symlink hop. For Homebrew pythons this resolves
/opt/homebrew/bin/python3.12through the version-pinnedCellar/python@3.12/<version>path, recording ahomethat breaks onbrew upgradeand changes the alias under which the base site-packages appears in created environments (caught by pypa/virtualenv CI on thebrew@3.12/brew@3.13jobs). It also needlessly rewrites stable aliases like Debian's/usr/bin/python3.Real
getpathonly follows the executable symlink while the stdlib landmark is missing next to it. Mirror that: stop resolving once<dir>/../lib(64)/pythonX.Y/os.pyis reachable, and skip resolution entirely for macOS framework builds, which self-locate through the real binary via dyld at runtime.