-
-
Notifications
You must be signed in to change notification settings - Fork 16.2k
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
Breaking change in markupsafe makes flask crash on service startup #4456
Comments
Duplicate of #4455 You are using an unsupported version of Flask and Jinja, please update to the latest version. Additionally, please read https://hynek.me/articles/semver-will-not-save-you/, then use a tool like pip-tools to pin your dependencies and control when you get updates. Be sure to run your tests with deprecation warnings treated as errors so that you get notified of these types of changes early. |
Flask is no longer maintaining the 1.x.x branch, and has in fact broken it with pallets/flask#4456. Since just installing flask 1.1.4 is no longer sufficient to run our specs and insure compatibility, I've opted to follow suite and only support flask 2 going forward. If flask does decide to do further maintenance on 1.1.5 I will consider reverting this PR and doing whatever updates we need to in order to insure that they type checking isn't broken.
* Fix mypy error This should allow us to add a CI check for type checking going forward * Drop flask1 support Flask is no longer maintaining the 1.x.x branch, and has in fact broken it with pallets/flask#4456. Since just installing flask 1.1.4 is no longer sufficient to run our specs and insure compatibility, I've opted to follow suite and only support flask 2 going forward. If flask does decide to do further maintenance on 1.1.5 I will consider reverting this PR and doing whatever updates we need to in order to insure that they type checking isn't broken. * Fix type checking imports for python < 3.8
This comment was marked as off-topic.
This comment was marked as off-topic.
This patch prevents this problem: *** Operational MODE: single process *** mounting api:app on / Traceback (most recent call last): File "./api.py", line 17, in <module> from flask import Flask File "/usr/local/lib/python3.7/dist-packages/flask/__init__.py", line 19, in <module> from . import json File "/usr/local/lib/python3.7/dist-packages/flask/json/__init__.py", line 15, in <module> from itsdangerous import json as _json ImportError: cannot import name 'json' from 'itsdangerous' (/usr/local/lib/python3.7/dist-packages/itsdangerous/__init__.py) unable to load app 0 (mountpoint='/') (callable not found or import error) See for reference: * https://serverfault.com/questions/1094062/error-from-itsdangerous-import-json-as-json-importerror-cannot-import-name-j * pallets/flask#4456 Signed-off-by: Arturo Borrero Gonzalez <[email protected]> Change-Id: Ia5f4001a438b95d25c791f5efaa5170c16665547
If you have a dependency on an older version of Flask like myself, I found a solution by following #4455 (comment) given by @fwindolf. My versions:
|
This issue in markupsafe is transitively included in flask, so even applications running Flask 1.1.4 are crashing on startup.
Here is a sample stack trace:
Environment:
The text was updated successfully, but these errors were encountered: