From bb1956da551e2cfdbc916f1cfbaf8f1e35719b46 Mon Sep 17 00:00:00 2001 From: Adorilson Bezerra Date: Thu, 5 Nov 2026 08:22:17 -0300 Subject: [PATCH] [Doc] Fix argument name of os.spawn* functions (GH-121094) Replace argument names *path* for *file*, the real names from them. It's possible to pass these as keyword arguments to the `*v*` functions; the following doesn't work: os.spawnv(mode=os.P_WAIT, path='/usr/bin/echo', args=['echo', 'hi']) (cherry picked from commit 288cc2bfc83d30cac834abcb4e69c36eda1ef5cb) Co-authored-by: Adorilson Bezerra --- Doc/library/os.rst | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Doc/library/os.rst b/Doc/library/os.rst index 117956288d32b5..a1510a34340d1b 100644 --- a/Doc/library/os.rst +++ b/Doc/library/os.rst @@ -5456,16 +5456,16 @@ written in Python, such as a mail server's external command delivery program. .. versionadded:: 3.7 -.. function:: spawnl(mode, path, ...) - spawnle(mode, path, ..., env) +.. function:: spawnl(mode, file, ...) + spawnle(mode, file, ..., env) spawnlp(mode, file, ...) spawnlpe(mode, file, ..., env) - spawnv(mode, path, args) - spawnve(mode, path, args, env) + spawnv(mode, file, args) + spawnve(mode, file, args, env) spawnvp(mode, file, args) spawnvpe(mode, file, args, env) - Execute the program *path* in a new process. + Execute the program *file* in a new process. (Note that the :mod:`subprocess` module provides more powerful facilities for spawning new processes and retrieving their results; using that module is @@ -5497,7 +5497,7 @@ written in Python, such as a mail server's external command delivery program. discussed in the next paragraph), the new environment is used as the source of the :envvar:`PATH` variable. The other variants, :func:`spawnl`, :func:`spawnle`, :func:`spawnv`, and :func:`spawnve`, will not use the - :envvar:`PATH` variable to locate the executable; *path* must contain an + :envvar:`PATH` variable to locate the executable; *file* must contain an appropriate absolute or relative path. For :func:`spawnle`, :func:`spawnlpe`, :func:`spawnve`, and :func:`spawnvpe` @@ -5518,7 +5518,7 @@ written in Python, such as a mail server's external command delivery program. L = ['cp', 'index.html', '/dev/null'] os.spawnvpe(os.P_WAIT, 'cp', L, os.environ) - .. audit-event:: os.spawn mode,path,args,env os.spawnl + .. audit-event:: os.spawn mode,file,args,env os.spawnl .. availability:: Unix, Windows, not WASI, not Android, not iOS.