]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.11] gh-104372: Cleanup _posixsubprocess make_inheritable for async signal safety...
authorGregory P. Smith <greg@krypto.org>
Wed, 24 May 2023 03:42:25 +0000 (20:42 -0700)
committerGitHub <noreply@github.com>
Wed, 24 May 2023 03:42:25 +0000 (20:42 -0700)
commit6d00ae3c28b254feeb3c1a81e38db92109180c47
treecce1c41a6fb2af6551f9a4d2102522080066fe42
parent582aadc80e566fe8ab9b15d4d221e1ea84d03c6a
[3.11] gh-104372: Cleanup _posixsubprocess make_inheritable for async signal safety gh-104518 (#104785)

Move all of the Python C API calls into the parent process up front
instead of doing PyLong_AsLong and PyErr_Occurred and PyTuple_GET from
the post-fork/vfork child process.

Much of this was long overdue. We shouldn't have been using PyTuple and
PyLong APIs within all of these low level functions anyways.

This is a backport of c649df6 for #104518 and the tiny adjustment in d1732fe #104697.

Backporting this allows backporting of the real bug fix that requires it.

Co-authored-by: Gregory P. Smith [Google] <greg@krypto.org>
Misc/NEWS.d/next/Library/2023-05-17-08-01-36.gh-issue-104372.jpoWs6.rst [new file with mode: 0644]
Modules/_posixsubprocess.c