Skip to content

Commit 9afffbc

Browse files
[3.14] [Doc] Fix argument name of os.spawn* functions (GH-121094) (GH-161413)
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 288cc2b) Co-authored-by: Adorilson Bezerra <adorilson@gmail.com>
1 parent e35d340 commit 9afffbc

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

‎Doc/library/os.rst‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5033,16 +5033,16 @@ written in Python, such as a mail server's external command delivery program.
50335033
.. versionadded:: 3.7
50345034

50355035

5036-
.. function:: spawnl(mode, path, ...)
5037-
spawnle(mode, path, ..., env)
5036+
.. function:: spawnl(mode, file, ...)
5037+
spawnle(mode, file, ..., env)
50385038
spawnlp(mode, file, ...)
50395039
spawnlpe(mode, file, ..., env)
5040-
spawnv(mode, path, args)
5041-
spawnve(mode, path, args, env)
5040+
spawnv(mode, file, args)
5041+
spawnve(mode, file, args, env)
50425042
spawnvp(mode, file, args)
50435043
spawnvpe(mode, file, args, env)
50445044

5045-
Execute the program *path* in a new process.
5045+
Execute the program *file* in a new process.
50465046

50475047
(Note that the :mod:`subprocess` module provides more powerful facilities for
50485048
spawning new processes and retrieving their results; using that module is
@@ -5074,7 +5074,7 @@ written in Python, such as a mail server's external command delivery program.
50745074
discussed in the next paragraph), the new environment is used as the source of
50755075
the :envvar:`PATH` variable. The other variants, :func:`spawnl`,
50765076
:func:`spawnle`, :func:`spawnv`, and :func:`spawnve`, will not use the
5077-
:envvar:`PATH` variable to locate the executable; *path* must contain an
5077+
:envvar:`PATH` variable to locate the executable; *file* must contain an
50785078
appropriate absolute or relative path.
50795079

50805080
For :func:`spawnle`, :func:`spawnlpe`, :func:`spawnve`, and :func:`spawnvpe`
@@ -5095,7 +5095,7 @@ written in Python, such as a mail server's external command delivery program.
50955095
L = ['cp', 'index.html', '/dev/null']
50965096
os.spawnvpe(os.P_WAIT, 'cp', L, os.environ)
50975097

5098-
.. audit-event:: os.spawn mode,path,args,env os.spawnl
5098+
.. audit-event:: os.spawn mode,file,args,env os.spawnl
50995099

51005100
.. availability:: Unix, Windows, not WASI, not Android, not iOS.
51015101

0 commit comments

Comments
 (0)