title: Subprocess Hanging on Wait
body: <p>From the documentation of <code>Popen.wait()</code>, I see</p>
  
  <blockquote>
    <p>Warning This will deadlock when using stdout=PIPE and/or stderr=PIPE
    and the child process generates enough output to a pipe such that it
    blocks waiting for the OS pipe buffer to accept more data. Use
    communicate() to avoid that.</p>
  </blockquote>
  
  <p>I am having a bit of trouble understanding the behavior below as the <code>command</code> run below can generate a fairly large amount of standard out.</p>
  
  <p>However, what I notice is that </p>
  
  <p><code>subproc = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)</code> </p>
  
  <p>will hang. </p>
  
  <p>While </p>
  
  <p><code>subproc = subprocess.Popen(command, stdout=subprocess.PIPE)</code></p>
  
  <p>will not hang.</p>
  
  <p>If the <code>command</code> is generating a large amount of standard out, why does the second statement not hang as we are still using <code>stdout=subprocess.PIPE</code>?</p>