summaryrefslogtreecommitdiffstats
path: root/Doc/library/subprocess.rst
diff options
context:
space:
mode:
authoruniocto <serit142sa33go@gmail.com>2021-05-11 20:47:05 (GMT)
committerGitHub <noreply@github.com>2021-05-11 20:47:05 (GMT)
commit5f2eb87f2893c5e77ade4d662cebcce59d3f2c2f (patch)
treeafb7f404d673392cb55fa326714f0c28c0a225de /Doc/library/subprocess.rst
parent12e7d10dfd28d4e26304e2c06b2e41c7418ec6f3 (diff)
downloadcpython-5f2eb87f2893c5e77ade4d662cebcce59d3f2c2f.zip
cpython-5f2eb87f2893c5e77ade4d662cebcce59d3f2c2f.tar.gz
cpython-5f2eb87f2893c5e77ade4d662cebcce59d3f2c2f.tar.bz2
bpo-23750: Document os-system, subprocess. Patch by Martin Panter. (GH-26016)
* Document os-system, subprocess Patch * Update Doc/library/os.rst Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com> Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
Diffstat (limited to 'Doc/library/subprocess.rst')
-rw-r--r--Doc/library/subprocess.rst8
1 files changed, 7 insertions, 1 deletions
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::