Skip to content

Commit bb1956d

Browse files
adorilsonmiss-islington
authored andcommitted
[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 288cc2b) Co-authored-by: Adorilson Bezerra <adorilson@gmail.com>
1 parent 57e3d34 commit bb1956d

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
@@ -5456,16 +5456,16 @@ written in Python, such as a mail server's external command delivery program.
54565456
.. versionadded:: 3.7
54575457

54585458

5459-
.. function:: spawnl(mode, path, ...)
5460-
spawnle(mode, path, ..., env)
5459+
.. function:: spawnl(mode, file, ...)
5460+
spawnle(mode, file, ..., env)
54615461
spawnlp(mode, file, ...)
54625462
spawnlpe(mode, file, ..., env)
5463-
spawnv(mode, path, args)
5464-
spawnve(mode, path, args, env)
5463+
spawnv(mode, file, args)
5464+
spawnve(mode, file, args, env)
54655465
spawnvp(mode, file, args)
54665466
spawnvpe(mode, file, args, env)
54675467

5468-
Execute the program *path* in a new process.
5468+
Execute the program *file* in a new process.
54695469

54705470
(Note that the :mod:`subprocess` module provides more powerful facilities for
54715471
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.
54975497
discussed in the next paragraph), the new environment is used as the source of
54985498
the :envvar:`PATH` variable. The other variants, :func:`spawnl`,
54995499
:func:`spawnle`, :func:`spawnv`, and :func:`spawnve`, will not use the
5500-
:envvar:`PATH` variable to locate the executable; *path* must contain an
5500+
:envvar:`PATH` variable to locate the executable; *file* must contain an
55015501
appropriate absolute or relative path.
55025502

55035503
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.
55185518
L = ['cp', 'index.html', '/dev/null']
55195519
os.spawnvpe(os.P_WAIT, 'cp', L, os.environ)
55205520

5521-
.. audit-event:: os.spawn mode,path,args,env os.spawnl
5521+
.. audit-event:: os.spawn mode,file,args,env os.spawnl
55225522

55235523
.. availability:: Unix, Windows, not WASI, not Android, not iOS.
55245524

0 commit comments

Comments
 (0)