Capture “Segmentation fault” message for a crashed subprocess: no out and err after a call to communicate()

“Segmentation fault” message might be generated by a shell. To find out, whether the process is kill by SIGSEGV, check proc.returncode == -signal.SIGSEGV. If you want to see the message, you could run the command in the shell: #!/usr/bin/env python from subprocess import Popen, PIPE proc = Popen(shell_command, shell=True, stdout=PIPE, stderr=PIPE) out, err = proc.communicate() … Read more