diff options
author | uniocto <serit142sa33go@gmail.com> | 2021-05-11 20:47:05 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-11 20:47:05 (GMT) |
commit | 5f2eb87f2893c5e77ade4d662cebcce59d3f2c2f (patch) | |
tree | afb7f404d673392cb55fa326714f0c28c0a225de /Doc/library/subprocess.rst | |
parent | 12e7d10dfd28d4e26304e2c06b2e41c7418ec6f3 (diff) | |
download | cpython-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.rst | 8 |
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:: |