[Python-checkins] bpo-38092: Reduce overhead when using multiprocessing in a Windows virtual environment (GH-16098)

Miss Islington (bot) webhook-mailer at python.org
Fri Sep 13 12:40:24 EDT 2019


https://github.com/python/cpython/commit/f2b7556ef851ac85e7cbf189d1b29fdeb9539b88
commit: f2b7556ef851ac85e7cbf189d1b29fdeb9539b88
branch: master
author: Steve Dower <steve.dower at python.org>
committer: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
date: 2019-09-13T09:40:19-07:00
summary:

bpo-38092: Reduce overhead when using multiprocessing in a Windows virtual environment (GH-16098)



https://bugs.python.org/issue38092

files:
A Misc/NEWS.d/next/Windows/2019-09-13-14-11-42.bpo-38092.x31ehI.rst
M Lib/multiprocessing/popen_spawn_win32.py
M Lib/multiprocessing/spawn.py

diff --git a/Lib/multiprocessing/popen_spawn_win32.py b/Lib/multiprocessing/popen_spawn_win32.py
index ea9c555da39a..9c4098d0fa4f 100644
--- a/Lib/multiprocessing/popen_spawn_win32.py
+++ b/Lib/multiprocessing/popen_spawn_win32.py
@@ -72,7 +72,7 @@ def __init__(self, process_obj):
             try:
                 hp, ht, pid, tid = _winapi.CreateProcess(
                     python_exe, cmd,
-                    env, None, False, 0, None, None, None)
+                    None, None, False, 0, env, None, None)
                 _winapi.CloseHandle(ht)
             except:
                 _winapi.CloseHandle(rhandle)
diff --git a/Lib/multiprocessing/spawn.py b/Lib/multiprocessing/spawn.py
index 7cc129e26107..075f3455478b 100644
--- a/Lib/multiprocessing/spawn.py
+++ b/Lib/multiprocessing/spawn.py
@@ -36,7 +36,7 @@
 if WINSERVICE:
     _python_exe = os.path.join(sys.exec_prefix, 'python.exe')
 else:
-    _python_exe = sys.executable
+    _python_exe = sys._base_executable
 
 def set_executable(exe):
     global _python_exe
diff --git a/Misc/NEWS.d/next/Windows/2019-09-13-14-11-42.bpo-38092.x31ehI.rst b/Misc/NEWS.d/next/Windows/2019-09-13-14-11-42.bpo-38092.x31ehI.rst
new file mode 100644
index 000000000000..48e83c8d1567
--- /dev/null
+++ b/Misc/NEWS.d/next/Windows/2019-09-13-14-11-42.bpo-38092.x31ehI.rst
@@ -0,0 +1 @@
+Reduce overhead when using multiprocessing in a Windows virtual environment.



More information about the Python-checkins mailing list