summaryrefslogtreecommitdiffstats
path: root/Doc/library
diff options
context:
space:
mode:
Diffstat (limited to 'Doc/library')
-rw-r--r--Doc/library/os.rst8
-rw-r--r--Doc/library/subprocess.rst8
2 files changed, 11 insertions, 5 deletions
diff --git a/Doc/library/os.rst b/Doc/library/os.rst
index 6f9f321..24ba153 100644
--- a/Doc/library/os.rst
+++ b/Doc/library/os.rst
@@ -4211,12 +4211,12 @@ written in Python, such as a mail server's external command delivery program.
the Standard C function :c:func:`system`, and has the same limitations.
Changes to :data:`sys.stdin`, etc. are not reflected in the environment of
the executed command. If *command* generates any output, it will be sent to
- the interpreter standard output stream.
+ the interpreter standard output stream. The C standard does not
+ specify the meaning of the return value of the C function, so the return
+ value of the Python function is system-dependent.
On Unix, the return value is the exit status of the process encoded in the
- format specified for :func:`wait`. Note that POSIX does not specify the
- meaning of the return value of the C :c:func:`system` function, so the return
- value of the Python function is system-dependent.
+ format specified for :func:`wait`.
On Windows, the return value is that returned by the system shell after
running *command*. The shell is given by the Windows environment variable
diff --git a/Doc/library/subprocess.rst b/Doc/library/subprocess.rst
index b60db58..56b6b6e 100644
--- a/Doc/library/subprocess.rst
+++ b/Doc/library/subprocess.rst
@@ -1292,11 +1292,17 @@ Replacing :func:`os.system`
sts = os.system("mycmd" + " myarg")
# becomes
- sts = call("mycmd" + " myarg", shell=True)
+ retcode = call("mycmd" + " myarg", shell=True)
Notes:
* Calling the program through the shell is usually not required.
+* The :func:`call` return value is encoded differently to that of
+ :func:`os.system`.
+
+* The :func:`os.system` function ignores SIGINT and SIGQUIT signals while
+ the command is running, but the caller must do this separately when
+ using the :mod:`subprocess` module.
A more realistic example would look like this::