title: python popen.stdout.readline() hangs
body: <p>I am having a problem... does anyone knows why this code hangs in the while loop. The loop doesn't seem to catch the last line of the <code>stdout</code>.</p>
  <pre><code>working_file = subprocess.Popen([&quot;/pyRoot/iAmACrashyProgram&quot;], stdout=subprocess.PIPE, stdin=subprocess.PIPE, stderr=subprocess.PIPE)
  
  line = working_file.stdout.readline()
  working_file.stdout.flush()
  while working_file != &quot;&quot; :
      print(line)
      line = working_file.stdout.readline()
      working_file.stdout.flush()
  </code></pre>
  <p>The script hangs with the curser just blinking when <code>readline()</code> is encountered. I don't understand why. Can anyone shed some light?</p>