mirror of
https://github.com/python/cpython.git
synced 2025-11-01 10:45:30 +00:00
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:
parent
cde1335485
commit
48c907a15c
5 changed files with 21 additions and 10 deletions
|
|
@ -4570,7 +4570,8 @@ written in Python, such as a mail server's external command delivery program.
|
|||
Most users should use :func:`subprocess.run` instead of :func:`posix_spawn`.
|
||||
|
||||
The positional-only arguments *path*, *args*, and *env* are similar to
|
||||
:func:`execve`.
|
||||
:func:`execve`. *env* is allowed to be ``None``, in which case current
|
||||
process' environment is used.
|
||||
|
||||
The *path* parameter is the path to the executable file. The *path* should
|
||||
contain a directory. Use :func:`posix_spawnp` to pass an executable file
|
||||
|
|
@ -4645,6 +4646,9 @@ written in Python, such as a mail server's external command delivery program.
|
|||
|
||||
.. versionadded:: 3.8
|
||||
|
||||
.. versionchanged:: 3.13
|
||||
*env* parameter accepts ``None``.
|
||||
|
||||
.. availability:: Unix, not Emscripten, not WASI.
|
||||
|
||||
.. function:: posix_spawnp(path, argv, env, *, file_actions=None, \
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue