title: Why does Popen.terminate() terminate subprocess run with command interpreter (cmd.exe) on Windows?
body: <p>Killing subprocess created with <code>shell=True</code> passed to <code>subprocess.Popen</code>'s constructor under Linux kills only shell and not the process created by shell (see <a href="https://stackoverflow.com/questions/4789837/">How to terminate a python subprocess launched with shell=True</a>). However <code>python -c "import subprocess; subprocess.Popen(['ping', '-t', 'google.com'], shell=True).terminate()"</code> run under Windows Vista x64 SP3 and Python 2.7.3 64bit kills the <code>ping</code> process. Under Windows <code>subprocess.Popen.terminate()</code> <a href="http://hg.python.org/cpython/file/70274d53c1dd/Lib/subprocess.py#l1019" rel="nofollow noreferrer">calls</a> <code>TerminateProcess</code>. However <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/ms686714.aspx" rel="nofollow noreferrer">documentation</a> of this function states</p>
  
  <blockquote>
    <p>Terminates the specified process and all of its threads.</p>
  </blockquote>
  
  <p>There is no mention about terminating whole process tree. What am I missing?</p>