title: pid of a process created by python subprocess.Popen(shell=True) is not the pid of the spawned shell
body: <p>i have a python script for test:</p>
  
  <pre><code>test.py:
  #coding=utf-8
  import os
  import time
  
  print os.getpid()
  </code></pre>
  
  <p>call it by subprocess.Popen:</p>
  
  <pre><code>p = sp.Popen("python test.py", shell=True)
  print p.pid
  </code></pre>
  
  <p>different outputs of these two print statement are expected as p.pid should be the pid of the shell process spawned, but the real output is:</p>
  
  <pre><code>In [18]: p = sp.Popen("python test.py", shell=True)
  
  In [19]: 19108
  
  In [19]: p.pid
  Out[19]: 19108
  </code></pre>