-
Notifications
You must be signed in to change notification settings - Fork 143
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Encrypted cookies don't work in Python 3.2 #21
Comments
https://github.com/bbangert/beaker/blob/master/beaker/crypto/pbkdf2.py#L160 In Python3, line 160 converts passphrase to "bytes" type: passphrase = passphrase.encode("UTF-8") Then, line 161 checks if the variable has type "str" and proceeds to raise an exception: if not isinstance(passphrase, str) |
Any update on this? Thanks! |
I'm open to pull requests that fix this while retaining backwards compatibility. |
backported pbkdf2 and added four pbkdf2 related tests to ensure behaviour is the same as before. |
Beaker is now natively python3 compatible and will be released as 1.7.0dev as a prerelease |
🍰 |
It appears that none of the beaker.crypto code is ready for Python 3. In particular, pbkdf2.py does a bunch of isinstance() checks which enforce that the encryption keys are 'str' objects, and calls encode() on them if not. This is of course precisely backwards when working with str and bytes in Python 3.
I've tried making a few patches to the code, but this only serves to reveal additional issues, and I don't have the time to prepare a complete patch for now.
In the meantime, please update the docs to indicate that encrypted cookies (that is, cookie-only sessions) are not supported when running under Python 3.
The text was updated successfully, but these errors were encountered: