title: How to remove b and \n from variable/text file in Python3? (TypeError)
body: <p>This gives me a massive headache. My code:</p>
  
  <pre><code>import subprocess
  proc = subprocess.Popen("php /var/scripts/data.php", shell=True, stdout=subprocess.PIPE)
  scriptresponse = proc.stdout.read()
  print (scriptresponse)
  </code></pre>
  
  <p>Output:</p>
  
  <blockquote>
    <p>b'January\n'</p>
  </blockquote>
  
  <p>I tried <code>scriptresponse.replace ('\n', '')</code> but failed:</p>
  
  <blockquote>
    <p>TypeError: 'str' does not support the buffer interface</p>
  </blockquote>
  
  <p>How to remove <code>b</code> and <code>\n</code> from <code>scriptresponse</code> so the output will look like this:</p>
  
  <blockquote>
    <p>January</p>
  </blockquote>