gh-121381 Remove subprocess._USE_VFORK escape hatch (#121383)

This flag was added as an escape hatch in gh-91401 and backported to
Python 3.10. The flag broke at some point between its addition and now.
As there is currently no publicly known environments that require this,
remove it rather than work on fixing it.

This leaves the flag in the subprocess module to not break code which
may have used / checked the flag itself.

discussion: https://discuss.python.org/t/subprocess-use-vfork-escape-hatch-broken-fix-or-remove/56915/2
This commit is contained in:
Cody Maloney 2024-07-30 18:39:54 -07:00 committed by GitHub
parent 82db572813
commit a9344cdffa
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 21 additions and 62 deletions

View file

@ -749,7 +749,6 @@ def _use_posix_spawn():
# These are primarily fail-safe knobs for negatives. A True value does not
# guarantee the given libc/syscall API will be used.
_USE_POSIX_SPAWN = _use_posix_spawn()
_USE_VFORK = True
_HAVE_POSIX_SPAWN_CLOSEFROM = hasattr(os, 'POSIX_SPAWN_CLOSEFROM')
@ -1902,7 +1901,7 @@ class Popen:
errpipe_read, errpipe_write,
restore_signals, start_new_session,
process_group, gid, gids, uid, umask,
preexec_fn, _USE_VFORK)
preexec_fn)
self._child_created = True
finally:
# be sure the FD is closed no matter what