Skip to content

Commit 55edd01

Browse files
committed
gh-125562: Added links between the system(), spawnl() and execl() documentation sections
1 parent 0a6e161 commit 55edd01

1 file changed

Lines changed: 23 additions & 6 deletions

File tree

Doc/library/os.rst

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4260,6 +4260,10 @@ These functions may be used to create and manage processes.
42604260
execvp(file, args)
42614261
execvpe(file, args, env)
42624262

4263+
(Note that the :mod:`subprocess` module provides more powerful facilities for
4264+
spawning new processes and retrieving their results; using that module is
4265+
preferable to using these functions.)
4266+
42634267
These functions all execute a new program, replacing the current process; they
42644268
do not return. On Unix, the new executable is loaded into the current process,
42654269
and will have the same process id as the caller. Errors will be reported as
@@ -4334,6 +4338,11 @@ These functions may be used to create and manage processes.
43344338
.. versionchanged:: 3.6
43354339
Accepts a :term:`path-like object`.
43364340

4341+
.. seealso::
4342+
The :mod:`subprocess` module.
4343+
4344+
The :func:`system` and :func:`spawnl` functions also execute a system command.
4345+
43374346
.. function:: _exit(n)
43384347

43394348
Exit the process with status *n*, without calling cleanup handlers, flushing
@@ -4839,13 +4848,14 @@ written in Python, such as a mail server's external command delivery program.
48394848
spawnvp(mode, file, args)
48404849
spawnvpe(mode, file, args, env)
48414850

4842-
Execute the program *path* in a new process.
48434851

48444852
(Note that the :mod:`subprocess` module provides more powerful facilities for
48454853
spawning new processes and retrieving their results; using that module is
48464854
preferable to using these functions. Check especially the
48474855
:ref:`subprocess-replacements` section.)
48484856

4857+
Execute the program *path* in a new process.
4858+
48494859
If *mode* is :const:`P_NOWAIT`, this function returns the process id of the new
48504860
process; if *mode* is :const:`P_WAIT`, returns the process's exit code if it
48514861
exits normally, or ``-signal``, where *signal* is the signal that killed the
@@ -4908,6 +4918,10 @@ written in Python, such as a mail server's external command delivery program.
49084918
These functions are :term:`soft deprecated` and should no longer be used
49094919
to write new code. The :mod:`subprocess` module is recommended instead.
49104920

4921+
.. seealso::
4922+
The :mod:`subprocess` module.
4923+
4924+
The :func:`system` and :func:`execl` functions also execute a system command.
49114925

49124926
.. data:: P_NOWAIT
49134927
P_NOWAITO
@@ -4994,6 +5008,10 @@ written in Python, such as a mail server's external command delivery program.
49945008

49955009
.. function:: system(command)
49965010

5011+
(Note that the :mod:`subprocess` module provides more powerful facilities for
5012+
executing programs; using that module is preferable to using these functions.
5013+
Refer to the :ref:`subprocess-replacements` section for some helpful recipes.)
5014+
49975015
Execute the command (a string) in a subshell. This is implemented by calling
49985016
the Standard C function :c:func:`system`, and has the same limitations.
49995017
Changes to :data:`sys.stdin`, etc. are not reflected in the environment of
@@ -5011,11 +5029,6 @@ written in Python, such as a mail server's external command delivery program.
50115029
status of the command run; on systems using a non-native shell, consult your
50125030
shell documentation.
50135031

5014-
The :mod:`subprocess` module provides more powerful facilities for spawning
5015-
new processes and retrieving their results; using that module is recommended
5016-
to using this function. See the :ref:`subprocess-replacements` section in
5017-
the :mod:`subprocess` documentation for some helpful recipes.
5018-
50195032
On Unix, :func:`waitstatus_to_exitcode` can be used to convert the result
50205033
(exit status) into an exit code. On Windows, the result is directly the exit
50215034
code.
@@ -5024,6 +5037,10 @@ written in Python, such as a mail server's external command delivery program.
50245037

50255038
.. availability:: Unix, Windows, not WASI, not Android, not iOS.
50265039

5040+
.. seealso::
5041+
The :mod:`subprocess` module.
5042+
5043+
The :func:`execl` and :func:`spawnl` functions also execute a system command.
50275044

50285045
.. function:: times()
50295046

0 commit comments

Comments
 (0)