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

New flask release deprecates flask.json.JSONEncoder which is used by the pinned flask_wtf 0.x #33

Open
oegedijk opened this issue May 2, 2023 · 0 comments

Comments

@oegedijk
Copy link
Contributor

oegedijk commented May 2, 2023

So Flask 2.3.0 deprecates a bunch of json support: https://flask.palletsprojects.com/en/2.3.x/changes/#version-2-3-0

This has been anticipated in flask-wtf release 1.1.1.

However flask-simplelogin pins flask-wtf to 0.x:

Flask-WTF = "^0.15.1"

resulting in the following error in my explainerdashboard library that uses flask_simplelogin as a dependency:

ImportError while loading conftest '/home/runner/work/explainerdashboard/explainerdashboard/tests/conftest.py'.
tests/conftest.py:21: in <module>
    from explainerdashboard import RegressionExplainer, ClassifierExplainer, ExplainerDashboard, ExplainerHub
explainerdashboard/__init__.py:5: in <module>
    from .dashboards import ExplainerDashboard, ExplainerHub, InlineExplainer
explainerdashboard/dashboards.py:41: in <module>
    from flask_simplelogin import SimpleLogin, login_required
/opt/hostedtoolcache/Python/3.9.[16](https://github.com/oegedijk/explainerdashboard/actions/runs/4856284560/jobs/8655687817#step:6:17)/x64/lib/python3.9/site-packages/flask_simplelogin/__init__.py:24: in <module>
    from flask_wtf import FlaskForm
/opt/hostedtoolcache/Python/3.9.16/x64/lib/python3.9/site-packages/flask_wtf/__init__.py:3: in <module>
    from .recaptcha import *
/opt/hostedtoolcache/Python/3.9.16/x64/lib/python3.9/site-packages/flask_wtf/recaptcha/__init__.py:2: in <module>
    from .fields import *
/opt/hostedtoolcache/Python/3.9.16/x64/lib/python3.9/site-packages/flask_wtf/recaptcha/fields.py:3: in <module>
    from . import widgets
/opt/hostedtoolcache/Python/3.9.16/x64/lib/python3.9/site-packages/flask_wtf/recaptcha/widgets.py:4: in <module>
    JSONEncoder = json.JSONEncoder
E   AttributeError: module 'flask.json' has no attribute 'JSONEncoder'

So would be great if you could upgrade the dependency of flask-wtf!

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

No branches or pull requests

1 participant