]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-34651: Only allow the main interpreter to fork. (gh-9279)
authorEric Snow <ericsnowcurrently@gmail.com>
Fri, 14 Sep 2018 21:17:20 +0000 (14:17 -0700)
committerGitHub <noreply@github.com>
Fri, 14 Sep 2018 21:17:20 +0000 (14:17 -0700)
commit5903296045b586b9cd1fce0b1e02caf896028d1d
tree99e8900633096060e931980d52e063c044870d3c
parent3faaa8857a42a36383bb18425444e597fc876797
bpo-34651: Only allow the main interpreter to fork. (gh-9279)

When os.fork() is called (on platforms that support it) all threads but the current one are destroyed in the child process. Consequently we must ensure that all but the associated interpreter are likewise destroyed. The main interpreter is critical for runtime operation, so we must ensure that fork only happens in the main interpreter.

https://bugs.python.org/issue34651
Include/internal/pystate.h
Lib/test/test__xxsubinterpreters.py
Misc/NEWS.d/next/Core and Builtins/2018-09-13-12-21-08.bpo-34651.v-bUeV.rst [new file with mode: 0644]
Modules/_posixsubprocess.c
Modules/posixmodule.c
Python/pystate.c