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_wtf no longer compatible with flask 2.3.0 #561

Closed
djundjila opened this issue Apr 25, 2023 · 2 comments · Fixed by #565
Closed

flask_wtf no longer compatible with flask 2.3.0 #561

djundjila opened this issue Apr 25, 2023 · 2 comments · Fixed by #565

Comments

@djundjila
Copy link

djundjila commented Apr 25, 2023

Problem:

flask_wtf's __init__ imports recaptcha, which in its __init__ imports fields, which in turn imports widgets, where the line from flask import Markup raises an ImportError. According to the changelog in flask 2.3.0 this is only only deprecated, but apparently it is actually a breaking change

To reproduce it:

pip install flask 2.3.0 and do `flask_wtf.csrf import CSRFProtect

Expected behaviour that didn't happen:

Is should import CSRFProtect without rasing an ImportError.

Environment:

  • Python version: 3.11
  • Flask-WTF version: 1.1.1
  • Flask version: 2.3.0
@djundjila
Copy link
Author

looks like changing this line to

from markupsafe import Markup

would fix it

matthew-shaw added a commit to matthew-shaw/flask-wtf that referenced this issue Apr 25, 2023
@davidism
Copy link
Member

Flask 2.3.1 fixes the early removal, we'll still update Flask-WTF as well

@wtforms wtforms deleted a comment from UniqASL May 16, 2023
jkittner pushed a commit to jkittner/flask-wtf that referenced this issue May 17, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 5, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging a pull request may close this issue.

2 participants