This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author steve.dower
Recipients chrullrich, davin, eryksun, ned.deily, paul.moore, pitrou, steve.dower, tim.golden, zach.ware
Date 2019-01-21.18:31:44
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1548095504.93.0.275686947024.issue35797@roundup.psfhosted.org>
In-reply-to
Content
> 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?
History
Date User Action Args
2019-01-21 18:31:46steve.dowersetrecipients: + steve.dower, paul.moore, pitrou, tim.golden, ned.deily, zach.ware, eryksun, chrullrich, davin
2019-01-21 18:31:44steve.dowersetmessageid: <1548095504.93.0.275686947024.issue35797@roundup.psfhosted.org>
2019-01-21 18:31:44steve.dowerlinkissue35797 messages
2019-01-21 18:31:44steve.dowercreate