◐ Shell
clean mode source ↗

[3.11] gh-87474: Fix file descriptor leaks in subprocess.Popen (GH-96351) by miss-islington · Pull Request #104563 · python/cpython

…GH-96351)

This fixes several ways file descriptors could be leaked from `subprocess.Popen` constructor during error conditions by opening them later and using a context manager "fds to close" registration scheme to ensure they get closed before returning.

---------

(cherry picked from commit 3a4c44b)

Co-authored-by: cptpcrd <31829097+cptpcrd@users.noreply.github.com>
Co-authored-by: Gregory P. Smith [Google] <greg@krypto.org>

This was referenced

May 16, 2023