8000 bpo-37951: Lift subprocess's fork() restriction (GH-15544) by tiran · Pull Request #15544 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

bpo-37951: Lift subprocess's fork() restriction (GH-15544) #15544

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 27, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
10000 Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
bpo-37951: Improve doc update
  • Loading branch information
tiran committed Aug 27, 2019
commit 224bde754e2a66c82aa79d8e6b814f80853877b2
5 changes: 3 additions & 2 deletions Doc/library/subprocess.rst
Original file line number Diff line number Diff line change
Expand Up @@ -486,8 +486,9 @@ functions.
.. versionchanged:: 3.8

The *preexec_fn* parameter is no longer supported in subinterpreters.
The new restriction may affect applications that are deployed in
mod_wsgi, uWSGI, and other environments.
The use of the parameter in a subinterpreter raises
:exc:`RuntimeError`. The new restriction may affect applications that
are deployed in mod_wsgi, uWSGI, and other embedded environments.

If *close_fds* is true, all file descriptors except :const:`0`, :const:`1` and
:const:`2` will be closed before the child process is executed. Otherwise
Expand Down
3 changes: 2 additions & 1 deletion Doc/whatsnew/3.8.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1532,7 +1532,8 @@ Changes in the Python API
(Contributed by Joannah Nanjekye and Victor Stinner in :issue:`35537`.)

* The *preexec_fn* argument of * :class:`subprocess.Popen` is no longer
compatible with subinterpreters.
compatible with subinterpreters. The use of the parameter in a
subinterpreter now raises :exc:`RuntimeError`.
(Contributed by Eric Snow in :issue:`34651`, modified by Christian Heimes
in :issue:`37951`.)

Expand Down
3 changes: 2 additions & 1 deletion Modules/_posixsubprocess.c
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,8 @@ subprocess_fork_exec(PyObject* self, PyObject *args)

if ((preexec_fn != Py_None) &&
(_PyInterpreterState_Get() != PyInterpreterState_Main())) {
PyErr_SetString(PyExc_RuntimeError, "preexec_fn not supported for subinterpreters");
PyErr_SetString(PyExc_RuntimeError,
"preexec_fn not supported within subinterpreters");
return NULL;
}

Expand Down
0