gh-113119 fix environment handling in subprocess.Popen when posix_spawn is used (#113120)

* Allow posix_spawn to inherit environment form parent environ variable.

With this change, posix_spawn call can behave similarly to execv with regards to environments when used in subprocess functions.
This commit is contained in:
Jakub Kulík 2023-12-17 06:19:05 +01:00 committed by GitHub
parent cde1335485
commit 48c907a15c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 21 additions and 10 deletions

View file

@ -1756,9 +1756,6 @@ class Popen:
c2pread, c2pwrite,
errread, errwrite):
"""Execute program using os.posix_spawn()."""
if env is None:
env = os.environ
kwargs = {}
if restore_signals:
# See _Py_RestoreSignals() in Python/pylifecycle.c