title: Do you have to check exit_status_ready if you are going to check recv_ready()?
body: <p>I am running a remote command with:</p>
  
  <pre><code>ssh = paramiko.SSHClient()
  ssh.connect(host)
  stdin, stdout, stderr = ssh.exec_command(cmd)
  </code></pre>
  
  <p>Now I want to get the output. I have seen things like this:</p>
  
  <pre><code># Wait for the command to finish
  while not stdout.channel.exit_status_ready():
      if stdout.channel.recv_ready():
          stdoutLines = stdout.readlines()
  </code></pre>
  
  <p>But that seems to sometimes never run the <code>readlines()</code> (even when there is supposed to be data on stdout). What that seems to mean to me is that stdout.channel.recv_ready() is not necessarily ready (True) as soon as stdout.channel.exit_status_ready() is True.</p>
  
  <p>Is something like this appropriate?</p>
  
  <pre><code># Wait until the data is available
  while not stdout.channel.recv_ready():
      pass
  
  stdoutLines = stdout.readlines()
  </code></pre>
  
  <p>That is, do I really first have to check the exit status before waiting for <code>recv_ready()</code> to say the data is ready?</p>
  
  <p>How would I know if there is supposed to be data on stdout before waiting in an infinite loop for stdout.channel.recv_ready() to become True (which it does not if there is not supposed to be any stdout output)?</p>