Killing subprocess created with shell=True
passed to subprocess.Popen
's constructor under Linux kills only shell and not the process created by shell (see How to terminate a python subprocess launched with shell=True). However python -c "import subprocess; subprocess.Popen(['ping', '-t', 'google.com'], shell=True).terminate()"
run under Windows Vista x64 SP3 and Python 2.7.3 64bit kills the ping
process. Under Windows subprocess.Popen.terminate()
calls TerminateProcess
. However documentation of this function states
Terminates the specified process and all of its threads.
There is no mention about terminating whole process tree. What am I missing?