Eryk Sun <eryk...@gmail.com> added the comment:

This should revert to setting `_python_exe = sys.executable` in 
Lib/multiprocessing/spawn.py. Then the code in 
Lib/multiprocessing/popen_spawn_win32.py will set __PYVENV_LAUNCHER__ in the 
spawned process to the virtual environment's sys.executable. Otherwise the 
worker process has no connection to the virtual environment, other than how 
sys.path gets manually copied from the parent process. In particular, without 
setting __PYVENV_LAUNCHER__, sys.executable is not the virtual-environment 
executable and sys.prefix is not the virtual-environment directory.

Also, the fix for the parameters that are passed to _winapi.CreateProcess needs 
to be backported to 3.7. Else __PYVENV_LAUNCHER__ won't actually be set in the 
child.

----------
nosy: +eryksun
resolution: fixed -> 
stage: resolved -> needs patch
status: closed -> open
versions: +Python 3.7

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue38092>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to