anfederico / flaskex

Simple flask example for quick prototypes and small applications
MIT License
827 stars 360 forks source link

Exception logging after a successful register #5

Closed aflp91 closed 6 years ago

aflp91 commented 7 years ago

I was attempting to logging after a first register. Here the output

Traceback (most recent call last): File "/Users/aperus/Documents/Projets/Flask/Flaskex/venv/lib/python2.7/site-packages/flask/app.py", line 1982, in wsgi_app response = self.full_dispatch_request() File "/Users/aperus/Documents/Projets/Flask/Flaskex/venv/lib/python2.7/site-packages/flask/app.py", line 1614, in full_dispatch_request rv = self.handle_user_exception(e) File "/Users/aperus/Documents/Projets/Flask/Flaskex/venv/lib/python2.7/site-packages/flask/app.py", line 1517, in handle_user_exception reraise(exc_type, exc_value, tb) File "/Users/aperus/Documents/Projets/Flask/Flaskex/venv/lib/python2.7/site-packages/flask/app.py", line 1612, in full_dispatch_request rv = self.dispatch_request() File "/Users/aperus/Documents/Projets/Flask/Flaskex/venv/lib/python2.7/site-packages/flask/app.py", line 1598, in dispatch_request return self.view_functionsrule.endpoint File "app.py", line 21, in login if helpers.credentials_valid(username, password): File "/Users/aperus/Documents/Projets/Flask/Flaskex/helpers.py", line 52, in credentials_valid return bcrypt.checkpw(password.encode('utf8'), user.password) File "/Users/aperus/Documents/Projets/Flask/Flaskex/venv/lib/python2.7/site-packages/bcrypt/init.py", line 101, in checkpw raise TypeError("Unicode-objects must be encoded before checking") TypeError: Unicode-objects must be encoded before checking

anfederico commented 6 years ago

This seems to be a Python 2.7 issue, specifically with bcrypt. Try running in Python 3.6, I'll update the README to reflect support for only Python 3.6.