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

DeprecationWarning: replace safe_str_cmp with hmac.compare_digest #126

Merged
merged 1 commit into from
May 13, 2021

Conversation

federicoemartinez
Copy link
Contributor

When using flask 2.0, we get:
flask_httpauth.py:249: DeprecationWarning: 'safe_str_cmp' is deprecated and will be removed in Werkzeug 2.1. Use 'hmac.compare_digest' instead. safe_str_cmp(client_password, stored_password) else None

This PR performs that change

@miguelgrinberg
Copy link
Owner

Thanks @federicoemartinez!

@federicoemartinez
Copy link
Contributor Author

I see it fails for python 2.7.
If I'm not wrong Werkzeug supports Python 3.6 and newer.
How would you like to handle this? I could check the python version and use safe_str_cmp if we are on python 2.7. We could also use six?

@miguelgrinberg miguelgrinberg merged commit 79e3ebf into miguelgrinberg:master May 13, 2021
@miguelgrinberg
Copy link
Owner

I removed Python 2 support, no need to keep it at this point. Thanks!

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

Successfully merging this pull request may close these issues.

2 participants