https://github.com/python/cpython/commit/288cc2bfc83d30cac834abcb4e69c36eda1ef5cb
commit: 288cc2bfc83d30cac834abcb4e69c36eda1ef5cb
branch: main
author: Adorilson Bezerra <[email protected]>
committer: encukou <[email protected]>
date: 2026-11-05T12:22:17+01:00
summary:
[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'])
files:
M Doc/library/os.rst
diff --git a/Doc/library/os.rst b/Doc/library/os.rst
index 80e119e720574e..ca8b60d57ead76 100644
--- a/Doc/library/os.rst
+++ b/Doc/library/os.rst
@@ -5530,16 +5530,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
@@ -5571,7 +5571,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`
@@ -5592,7 +5592,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.
_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]