[issue46028] 3.11.0a3: under tox, sys._base_executable is wrong

Steve Dower report at bugs.python.org
Mon Dec 13 17:24:47 EST 2021


Steve Dower <steve.dower at python.org> added the comment:

> $ cat venv_a3/pyvenv.cfg
> home = /home/ss/.pyenv/versions/3.11.0a3/bin

> $ venv_a3/bin/python -c "import sys,os.path; print(e := sys._base_executable); print(os.path.exists(e))"
> /home/ss/.pyenv/versions/3.11.0a3/bin/python
> True

This is the intended behaviour, and yes it's changed from previous versions (but not on Windows, where it was always correct). The previous value was incorrect, hence it was marked as an internal field.

If your venv doesn't have a "python" binary in the directory set as "home" in pyvenv.cfg (which by definition, according to Lib/venv/__init__.py, is dirname(sys.executable) ), then there's some other issue with venv on your platform.

----------
nosy: +vinay.sajip

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46028>
_______________________________________


More information about the Python-bugs-list mailing list