Message360590
> can you confirm that the fix is to just change spawn.get_executable()
> to return sys.executable, like it was prior to the PR mentioned in
> the other ticket?
Yes, in spawn.py, change `_python_exe = sys._base_executable` to `_python_exe = sys.executable`. This is the value that gets returned by spawn.get_executable().
This will restore the operation of the following code in Popen.__init__ in popen_spawn_win32.py:
python_exe = spawn.get_executable()
# bpo-35797: When running in a venv, we bypass the redirect
# executor and launch our base Python.
if WINENV and _path_eq(python_exe, sys.executable):
python_exe = sys._base_executable
env = os.environ.copy()
env["__PYVENV_LAUNCHER__"] = sys.executable
This code switches to running the base executable in a virtual environment, which is required in order to support duplicating handles to the child or stealing handles from the parent. And the startup code in the child process is made aware of virtual environment via the "__PYVENV_LAUNCHER__" environment variable. |
|
Date |
User |
Action |
Args |
2020-01-24 01:54:21 | eryksun | set | recipients:
+ eryksun, paul.moore, tim.golden, zach.ware, steve.dower, meilyadam |
2020-01-24 01:54:21 | eryksun | set | messageid: <1579830861.59.0.321868019044.issue39439@roundup.psfhosted.org> |
2020-01-24 01:54:21 | eryksun | link | issue39439 messages |
2020-01-24 01:54:21 | eryksun | create | |
|