title: telnetlib TypeError
body: <p>I am modifying a python script to make changes en masse to a hand full of switches via telnet:</p>
  
  <pre><code>import getpass
  import sys
  import telnetlib
  
  HOST = "192.168.1.1"
  user = input("Enter your remote account: ")
  password = getpass.getpass()
  
  tn = telnetlib.Telnet(HOST)
  
  tn.read_until("User Name: ")
  tn.write(user + "\n")
  if password:
      tn.read_until("Password: ")
      tn.write(password + "\n")
  
  tn.write("?\n")
  tn.write("exit\n")
  </code></pre>
  
  <p>When the script executes I receive a "TypeError: expected an object with the buffer interface" Any insight would be helpful.</p>