pallets-eco/flask-wtf

flask_wtf no longer compatible with flask 2.3.0

Closed this issue · 2 comments

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

looks like changing this line to

from markupsafe import Markup

would fix it

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