brcypt support broken for 2.0.0
Created originally on Bitbucket by Anonymous
(Imported from Google Code)
Jonathan.Banafato wrote:
What steps will reproduce the problem?
$ pip install bcrypt==2.0.0 passlib==1.6.2
$ python
>>> from passlib.hash import bcrypt
>>> bcrypt.encrypt('foo')
What is the expected output? What do you see instead?
Expected: hash value
Actual (Python 2 or bcryptsystem?
passlib==1.6.2, python 3.x, Mac OS X 10.10.3
Please provide any additional information below.
This is happening because of a change in bcrypt. passlib differentiates bcrypt from py-bcrypt using if not hasattr(_bcrypt, "_ffi"):
. bcrypt 2.0.0 has several code organizational changes, one of which affects this check. Changing the line to if not (hasattr(_bcrypt, "_ffi") or hasattr(_bcrypt, "_bcrypt")):
should handle both versions gracefully.