Message334163
> We need a way to allow multiprocessing to spawn the real python.exe instead of the launcher executable that's set as sys.executable.
Got to a computer and had just reached the same conclusion.
Given the environment is inherited, it's easy to do:
>>> import _winapi
>>> import multiprocessing.spawn
>>> multiprocessing.spawn.set_executable(_winapi.GetModuleFileName(0))
This may interfere with others who currently override sys.executable when hosting Python, since they'll get their override by default. But changing sys.executable to _not_ be the venv one will break anyone who doesn't correctly inherit environment variables (specifically, __PYVENV_LAUNCHER__, but this is deliberately not documented ;) ).
Perhaps we just change the multiprocessing default on Windows when sys.base_prefix != sys.prefix? |
|
Date |
User |
Action |
Args |
2019-01-21 18:31:46 | steve.dower | set | recipients:
+ steve.dower, paul.moore, pitrou, tim.golden, ned.deily, zach.ware, eryksun, chrullrich, davin |
2019-01-21 18:31:44 | steve.dower | set | messageid: <1548095504.93.0.275686947024.issue35797@roundup.psfhosted.org> |
2019-01-21 18:31:44 | steve.dower | link | issue35797 messages |
2019-01-21 18:31:44 | steve.dower | create | |
|