title: POST data should be bytes or an iterable of bytes. It cannot be of type str
body: <pre><code>def login(self):
      url = 'https://login.facebook.com/login.php?login_attempt=1'
      data = "locale=en_US&amp;non_com_login=&amp;email="+self.email+"&amp;pass="+self.password+"&amp;lsd=20TOl"
      usock = self.opener.open('http://www.facebook.com')
      usock = self.opener.open(url, data)
      if "Logout" in usock.read():
          print("Logged in.")
      else:
          print("failed login")
          print(usock.read())
          sys.exit()
  </code></pre>
  
  <p>Can you tell me how and were the error is?</p>
  
  <p>POST data should be bytes or an iterable of bytes. It cannot be of type str.</p>