title: Python3 .replace yielding TypeError: a bytes-like object is required, not 'str'
body: <p>I've been trying to read the output from a server with this code:</p>
  <pre><code>s = paramiko.SSHClient()
  s.load_system_host_keys()
  s.set_missing_host_key_policy(paramiko.AutoAddPolicy())
  s.connect(hostname, port, username, password)
  command = 'xe vm-list'
  (stdin, stdout, stderr) = s.exec_command(command)
  
  output = stdout.read()
  x = output.replace(&quot;\n&quot;, &quot;,&quot;).strip()
  print(x)
  s.close()
  </code></pre>
  <p>When the line &quot;x = output.replace(&quot;\n&quot;, &quot;,&quot;).strip()&quot; is run &quot;TypeError: a bytes-like object is required, not 'str'&quot; is thrown.</p>
  <p>What am I doing wrong?</p>