Skip to content
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

Unicode object must be encoded #143

Open
btnpushnmunky opened this issue Jun 26, 2014 · 2 comments
Open

Unicode object must be encoded #143

btnpushnmunky opened this issue Jun 26, 2014 · 2 comments

Comments

@btnpushnmunky
Copy link

Maybe you've seen this before, but I'm getting the following error when setting up a user:

Python 3.4.1 (default, May 19 2014, 13:10:29)
[GCC 4.2.1 Compatible Apple LLVM 5.1 (clang-503.0.40)] on darwin
Type "help", "copyright", "credits" or "license" for more information.

python
Traceback (most recent call last):
File "", line 1, in
NameError: name 'python' is not defined
from app import auth
admin = auth.User(username='admin', email=
... '', active=True, admin=True)
admin.set_password(
... 'admin')
Traceback (most recent call last):
File "", line 2, in
File "/Users/dross/Projects/timer/env/lib/python3.4/site-packages/flask_peewee/auth.py", line 22, in set_password
self.password = make_password(password)
File "/Users/dross/Projects/timer/env/lib/python3.4/site-packages/flask_peewee/utils.py", line 133, in make_password
salt = get_hexdigest(str(random.random()), str(random.random()))[:5]
File "/Users/dross/Projects/timer/env/lib/python3.4/site-packages/flask_peewee/utils.py", line 130, in get_hexdigest
return sha1(salt + raw_password).hexdigest()
TypeError: Unicode-objects must be encoded before hashing

@sc0tt
Copy link

sc0tt commented Jun 26, 2014

Related? #81

I don't think a new version has been released with this change though.

@btnpushnmunky
Copy link
Author

Installing directly from Github with pip works, so I believe @sc0tt is correct.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants