Skip to content

Commit 288cc2b

Browse files
authored
[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'])
1 parent 49c43f7 commit 288cc2b

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

55325532

5533-
.. function:: spawnl(mode, path, ...)
5534-
spawnle(mode, path, ..., env)
5533+
.. function:: spawnl(mode, file, ...)
5534+
spawnle(mode, file, ..., env)
55355535
spawnlp(mode, file, ...)
55365536
spawnlpe(mode, file, ..., env)
5537-
spawnv(mode, path, args)
5538-
spawnve(mode, path, args, env)
5537+
spawnv(mode, file, args)
5538+
spawnve(mode, file, args, env)
55395539
spawnvp(mode, file, args)
55405540
spawnvpe(mode, file, args, env)
55415541

5542-
Execute the program *path* in a new process.
5542+
Execute the program *file* in a new process.
55435543

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

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

5595-
.. audit-event:: os.spawn mode,path,args,env os.spawnl
5595+
.. audit-event:: os.spawn mode,file,args,env os.spawnl
55965596

55975597
.. availability:: Unix, Windows, not WASI, not Android, not iOS.
55985598

0 commit comments

Comments
 (0)