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

Flask Session not working after latest itsdangerous package upgrade #89

Closed
torre76 opened this issue Oct 19, 2018 · 3 comments
Closed

Comments

@torre76
Copy link

torre76 commented Oct 19, 2018

Hello,

Today I had a problem while deploying a project which is based on flask and Flask-Session.
I received this error at server startup:

  File "/opt/gl/sso/env/lib/python3.6/site-packages/flask_session/__init__.py", line 16, in <module>
    from .sessions import NullSessionInterface, RedisSessionInterface, \
  File "/opt/gl/sso/env/lib/python3.6/site-packages/flask_session/sessions.py", line 23, in <module>
    from itsdangerous import Signer, BadSignature, want_bytes
ImportError: cannot import name 'want_bytes'

Digging on this issue I found that the package itsdangerous released version 1.0.0 which it has no want_bytes function anymore.

Forcing my requirements.txt with itsdangerous>=0.24,<1.0.0 solved the problem but I think you should refactor the package since itsdangerous is a main dependency of flask.

@jcollard
Copy link

👍

@tvenstad
Copy link

The file structure of the itsdangerous package has changed. The function resides in the encoding.py file. Changing the import statements from:
from itsdangerous import Signer, BadSignature, want_bytes
to:
from itsdangerous import Signer, BadSignature
from itsdangerous.encoding import want_bytes
works for me.

@davidism
Copy link
Member

itsdangerous 1.1.0 was just released and contains a fix for this. Flask-Session should still be fixed so it doesn't rely on this, but it won't fail for now.

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

Successfully merging a pull request may close this issue.

5 participants