maxcountryman / flask-bcrypt

Flask-Bcrypt is a Flask extension that provides bcrypt hashing utilities for your application.

Home Page:http://readthedocs.org/docs/flask-bcrypt/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Python 3.10 support

JWKennington opened this issue · comments

The latest versions of flask-bcrypt don't support python 3.10, though many of the flask extensions we use have. This causes a problem since the 0.7.1 release of flask-bcrypt isn't updated for the latest version of werkzeug, which causes the following import error on python 3.10 environments

File "..env/lib/python3.9/site-packages/flask_bcrypt.py", line 21, in <module>
    from werkzeug.security import safe_str_cmp
ImportError: cannot import name 'safe_str_cmp' from 'werkzeug.security'

I just ran into the same issue, but was using version 0.7. Upgrading to 1.0.1 solved for me, and that line is not in the current version of the file anymore.

Issues with werkzeug > 2.2 (sometimes even with > 2.1) are common with many flask addons like flask-login and flask-restx. According to #86 this has already been fixed with 1.0.0. If that is not an option you might consider downgrading to werkzeug to a minor version < 2.1 (and therefore to a minor version of flask < 2.1 as well). Btw I don't get what this is issue has to do with python 3.10.