title: bcrypt.checkpw returns TypeError: Unicode-objects must be encoded before checking
body: <p>I am calling <code>bcrypt.checkpw</code> to check unencrypted password matches with hashed password stored in the credential database, but receive </p>
  
  <blockquote>
    <p>TypeError: Unicode-objects must be encoded before checking</p>
  </blockquote>
  
  <p>How should I resolve this issue? Any suggestion?<br>
  I installed <code>python 2.7.6</code>, and <code>bcrypt 3.1.1</code>  </p>
  
  <p>I have the following code:</p>
  
  <pre><code>def check_password(password, hashed_password)
      if not bcrypt.checkpw(password, hashed_password):
          raise InvalidCredentials("403 Forbidden")
      else:
          return true
  </code></pre>
  
  <p>And receive the following error:</p>
  
  <blockquote>
    <p>File "/home/qt/virtualenv/lib/python2.7/site-packages/bcrypt/<strong>init</strong>.py", line 100, in checkpw<br>
    raise TypeError("Unicoed-objects must be encoded before checking")<br>
    TypeError: Unicode-objects must be encoded before checking</p>
  </blockquote>
  
  <p>I looked into <code>bcrypt/__init__.py</code>, but I'm not sure why</p>
  
  <pre><code>def checkpw(password, hashed_password):    
      if (isinstance(password, six.text_type) or            
          isinstance(hashed_password, six.text_type)):        
      raise TypeError("Unicode-objects must be encoded before checking")
  </code></pre>