title: Popen stdout reading pipe, deadlock using sleep
body: <p>Well, I have two scripts. The a.py which prints the output of the b.py script as follows:</p>
  
  <pre><code>#a.py
  from subprocess import Popen, PIPE, STDOUT
  
  p = Popen(['/Users/damian/Desktop/b.py'], shell=False, stdout=PIPE, stderr=STDOUT)
  
  while p.poll() is None:
      print p.stdout.readline()
  
  
  #b.py
  #!/usr/bin/env python
  import time
  
  while 1:
      print 'some output'
      #time.sleep(1)
  </code></pre>
  
  <p>This works.But,
  Why do my scripts deadlock when I uncomment the time.sleep() line?</p>