This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author eryksun
Recipients eryksun, gaborjbernat, paul.moore, steve.dower, tim.golden, zach.ware
Date 2020-10-12.22:39:02
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1602542342.55.0.356523937968.issue42013@roundup.psfhosted.org>
In-reply-to
Content
> So I'm +1 on fixing this by calling realpath.

In POSIX, calculate_path() in Modules/getpath.c calls calculate_argv0_path() before it calls calculate_read_pyenv(), and calculate_argv0_path() in turn calls resolve_symlinks(&calculate->argv0_path). Thus "pyvenv.cfg" isn't found and isn't used to find the standard library in POSIX when a virtual environment uses symlinks. Later on, "pyvenv.cfg" gets read by the site module, if importing the latter isn't skipped via -S. The site module sets sys._home to the `home` value, but sys._home only appears to be used by sysconfig when running from the build directory.

In Windows, calculate_path() in PC/getpathp.c could get the final (real) path for argv0_path before calling calculate_pyvenv_file(). Then, just like in POSIX, the environment's "pyvenv.cfg" file won't be found and won't be used to find the standard library when a virtual environment uses symlinks.
History
Date User Action Args
2020-10-12 22:39:02eryksunsetrecipients: + eryksun, paul.moore, tim.golden, zach.ware, steve.dower, gaborjbernat
2020-10-12 22:39:02eryksunsetmessageid: <1602542342.55.0.356523937968.issue42013@roundup.psfhosted.org>
2020-10-12 22:39:02eryksunlinkissue42013 messages
2020-10-12 22:39:02eryksuncreate