title: Why Do I Get This Error Message When Using Telnet In Python Shell
body: <p>I am having a problem because I am trying to connect to my raspberry pi using telnet but when it comes to the part where it is reading for the username entry I get an error which I have pasted bellow.</p>
  
  <pre><code>#IMPORTS
  from tkinter import *
  import time
  import telnetlib
  import sys
  import getpass
  import tkinter.messagebox
  
  
  #TELNET
  user = input("Please Enter Your Username: ")
  time.sleep(0.4)
  pass_ = input("Please Enter Your Password: ")
  
  bot = telnetlib.Telnet("192.168.1.128")
  bot.read_until("login: ")
  bot.write(user + "\n")
  bot.read_until("Password: ")
  bot.write(pass_ + "\n")
  bot.write("cd PiBits/ServoBlaster")
  
  
  #DEFINITIONS
  
  
  #STUFF
  master = Tk()
  
  #LEFT
  left = Scale(master,from_=0,to=249,length=550,width=25,tickinterval=152,sliderlength=30)
  left.pack()
  left.set(152)
  left.grid(row=0, column=2)
  
  #RIGHT
  right = Scale(master,from_=0,to=249,length=550,width=25,tickinterval=152,sliderlength=30)
  right.pack()
  right.set(152)
  right.grid(row=0, column=12)
  
  #MIDDLE
  
  mid = Scale(master,from_=0,to=249,length=550,width=25,tickinterval=152,sliderlength=30)
  mid.pack()
  mid.set(152)
  mid.grid(row=0, column=7)
  
  #RUN CANVAS
  mainloop()
  </code></pre>
  
  <p>I get the following error message:</p>
  
  <pre><code>Traceback (most recent call last):
    File "/Users/kiancross/Desktop/PROJECTS/RASPBERRY_PI/ROBOT/CONTROLLER_GUI/RPi_BOT_CONTROLLER.py", line 16, in &lt;module&gt;
      bot.read_until("login: ", timeout=NONE)
    File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/telnetlib.py", line 304, in read_until
      i = self.cookedq.find(match)
  TypeError: Type str doesn't support the buffer API
  </code></pre>
  
  <p>Please can somebody tell me why I am getting the error message and how I can fix it?</p>
  
  <p>Thanks</p>