[issue38905] venv python reports wrong sys.executable in a subprocess on Windows

Jurko Gospodnetić report at bugs.python.org
Wed Jun 3 07:09:05 EDT 2020


Jurko Gospodnetić <jurko.gospodnetic at gmail.com> added the comment:

encountered what I believe is the same problem, so here are some more details I noticed, after checking what exactly that process name lookup does using ProcessMonitor:

- when running my external process in a `venv` generated virtual environment, POpen() started subprocess executables are first looked up in the base Python executable's folder (the one used to create our virtual environment) as opposed to the one running the external Python process, if POpen() is called with `shell=False`

- when doing the same and passing `shell=True` to the POpen() call, there is no such initial folder in the lookup

- when doing the same on a `virtualenv` generated virtual environment, the file lookup is done in the correct folder first - the one containing the current Python executable and not in the base one

----------
nosy: +Jurko.Gospodnetić

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


More information about the Python-bugs-list mailing list