brettkromkamp / contextualise

Contextualise is an effective tool particularly suited for organising information-heavy projects and activities consisting of unstructured and widely diverse data and information resources
https://contextualise.dev/
MIT License
1.04k stars 44 forks source link

Fix "ImportError: cannot import name 'safe_str_cmp' from 'werkzeug.security'" after upgrading to Flask/Werkzeug 2.10 #119

Closed brettkromkamp closed 2 years ago

brettkromkamp commented 2 years ago

Got an import error after upgrading to Flask/Werkzeug 2.10: Traceback (most recent call last): File "/home/brettk/.pyenv/versions/3.10.3/envs/contextualise-dev-2/lib/python3.10/site-packages/flask/cli.py", line 234, in locate_app __import__(module_name) File "/home/brettk/Source/structured-knowledge/contextualise/contextualise/__init__.py", line 14, in <module> from flask_seasurf import SeaSurf File "/home/brettk/.pyenv/versions/3.10.3/envs/contextualise-dev-2/lib/python3.10/site-packages/flask_seasurf.py", line 30, in <module> from werkzeug.security import safe_str_cmp ImportError: cannot import name 'safe_str_cmp' from 'werkzeug.security' (/home/brettk/.pyenv/versions/3.10.3/envs/contextualise-dev-2/lib/python3.10/site-packages/werkzeug/security.py)

brettkromkamp commented 2 years ago

The problem is with the Flask-SeaSurf extension. Perhaps time to migrate to Flask-WTF.

Relevant URLs:

brettkromkamp commented 2 years ago

Initial testing confirms that this was fixed with: https://github.com/maxcountryman/flask-seasurf/pull/108. Once definitively confirmed that this has been fixed, this issue will be closed.

brettkromkamp commented 2 years ago

Confirmed to be fixed with latest Flask-SeaSurf update.