title: subprocess Popen - decode
body: <p>In my script I was using this with decoding to utf-8:</p>
  <pre><code>result = subprocess.run(['command'], stdout=subprocess.PIPE).stdout.decode('utf-8')
  </code></pre>
  <p>Now I need to change command, where I need to use pipelines, so according to few examples which I have found, I need to use subprocess.Popen instead of subprocess.run. So I have something like this:</p>
  <pre><code>    r1 = subprocess.Popen(['command1'], stdout=subprocess.PIPE)
      r2 = subprocess.Popen(['command2'], stdin=r1.stdout, stdout=subprocess.PIPE)
      r3 = subprocess.Popen(['command3'], stdin=r2.stdout, stdout=subprocess.PIPE)
      result = r3.stdout
  </code></pre>
  <p>However, in this situation I can't add to the end <code>stdout.decode('utf-8')</code> because I get error</p>
  <pre><code>AttributeError: '_io.BufferedReader' object has no attribute 'decode'
  </code></pre>
  <p>Could someone help me, how can I decode it to utf8?</p>