
Martin Panter added the comment: Another difference is that (at least POSIX) system() blocks SIGINT and SIGQUIT while the child is running. Compare: $ python3 -c 'print("Waiting"); import os; print("Returned", os.system("sleep 3 && exit 3"))' Sleeping Returned 768 $ python3 -c 'print("Sleeping"); import os; print("Returned", os.system("sleep 3 && exit 3"))' Waiting ^CReturned 2 # Hit Ctrl+C during sleep command $ python3 -c 'print("Sleeping"); import subprocess; print("Returned", subprocess.call("sleep 3 && exit 3", shell=True))' Sleeping Returned 3 $ python3 -c 'print("Sleeping"); import subprocess; print("Returned", subprocess.call("sleep 3 && exit 3", shell=True))' Sleeping ^CTraceback (most recent call last): File "<string>", line 1, in <module> File "/usr/lib/python3.4/subprocess.py", line 539, in call return p.wait(timeout=timeout) File "/usr/lib/python3.4/subprocess.py", line 1566, in wait (pid, sts) = self._try_wait(0) File "/usr/lib/python3.4/subprocess.py", line 1514, in _try_wait (pid, sts) = _eintr_retry_call(os.waitpid, self.pid, wait_flags) File "/usr/lib/python3.4/subprocess.py", line 491, in _eintr_retry_call return func(*args) KeyboardInterrupt [Exit 1] ---------- nosy: +vadmium _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue23750> _______________________________________