title: Python Unicode and \xe2\x80\x98r\xe2\x80\x99 error
body: <blockquote>
    <p>Python version 3.5.2</p>
  </blockquote>
  
  <p>So I have file output from <code>mitmproxy</code> called <code>enter code here</code>, and I want to read it using:</p>
  
  <pre><code>from shelljob import proc
  
  g = proc.Group()
  command = "tail -f -c +0 output_file | mitmdump -n -r - --set flow_detail=1 --showhost"
  p = g.run (command)
  
  def read_process():
      while g.is_pending():
          lines = g.readlines()
          for proc, line in lines:
              print ("data:" + str(line) + '\n\n')
  </code></pre>
  
  <p>and returning</p>
  
  <pre><code>data:b'tail: invalid number of lines: \xe2\x80\x98r\xe2\x80\x99\n'
  </code></pre>
  
  <p>but if I change command to <code>ping 127.0.0.1</code>, like:</p>
  
  <pre><code>from shelljob import proc
  
  g = proc.Group()
  command = "ping 127.0.0.1"
  p = g.run (command)
  
  def read_process():
      while g.is_pending():
          lines = g.readlines()
          for proc, line in lines:
              print ("data:" + str(line) + '\n\n')
  </code></pre>
  
  <p>and it works fine!. returning:</p>
  
  <pre><code>data:b'64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.056 ms\n'
  </code></pre>
  
  <p>So what's the solution?</p>