pallets-eco / flask-session

Server side session extension for Flask
https://flask-session.readthedocs.io
BSD 3-Clause "New" or "Revised" License
507 stars 238 forks source link

Incompatibility issues with werkzeug 1.0 #112

Closed mcjlnrtwcz closed 4 years ago

mcjlnrtwcz commented 4 years ago

On February 6th a new version of Werkzeug was released: https://pypi.org/project/Werkzeug/#history It introduces a breaking API change which results in a crash.

Expected Behavior

Proper version of Werkzeug should be installed.

I think flask-session should use fixed version of flask - I reported the problem here https://github.com/pallets/flask/issues/3490

Actual Behavior

Flask application can't be tested.

/usr/lib/python3.7/unittest/mock.py:1204: in patched
    return func(*args, **keywargs)
doobar/test_utils/fixtures.py:72: in _stubbed_app
    return create_app('test')
doobar/__init__.py:41: in create_app
    Session(app)
venv/lib/python3.7/site-packages/flask_session/__init__.py:54: in __init__
    self.init_app(app)
venv/lib/python3.7/site-packages/flask_session/__init__.py:61: in init_app
    app.session_interface = self._get_interface(app)
venv/lib/python3.7/site-packages/flask_session/__init__.py:93: in _get_interface
    config['SESSION_USE_SIGNER'], config['SESSION_PERMANENT'])
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <flask_session.sessions.FileSystemSessionInterface object at 0x7f38e4d255c0>, cache_dir = '/tmp/doobar-sessions', threshold = 500, mode = 384, key_prefix = 'session:'
use_signer = False, permanent = True

    def __init__(self, cache_dir, threshold, mode, key_prefix,
                 use_signer=False, permanent=True):
>       from werkzeug.contrib.cache import FileSystemCache
E       ModuleNotFoundError: No module named 'werkzeug.contrib'

venv/lib/python3.7/site-packages/flask_session/sessions.py:313: ModuleNotFoundError

Environment

SqrtMinusOne commented 4 years ago

Added a PR to fix this #114

jakabk commented 4 years ago

Please merge the PR and release, plz, plz, plz.

rayluo commented 4 years ago

FYI: I encounter same problem, and I fixed it in my fork, and you can install it in this way.

VictorSyntez commented 4 years ago

FYI: I encounter same problem, and I fixed it in my fork, and you can install it in this way.

Thank you!

fengsp commented 4 years ago

Fixed since 0.3.2.