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

Jinja no longer supports Escape #68

Open
rennsport opened this issue Apr 6, 2022 · 1 comment
Open

Jinja no longer supports Escape #68

rennsport opened this issue Apr 6, 2022 · 1 comment

Comments

@rennsport
Copy link

rennsport commented Apr 6, 2022

As of version 3.1.0 of Jinja released March 24, 2022, Markup and Escape have been removed. The devs suggest importing them from MarkupSafe instead. See: https://jinja.palletsprojects.com/en/3.1.x/changes/#version-3-1-0

Flask 1.1.2 tries to import Escape from Jinja:

Traceback (most recent call last):
  File /usr/local/bin/nxbt, line 8, in <module>
    sys.exit(main())
  File /usr/local/lib/python3.8/dist-packages/nxbt/cli.py, line 321, in main
    from .web import start_web_app
  File /usr/local/lib/python3.8/dist-packages/nxbt/web/__init__.py, line 1, in <module>
    from .app import start_web_app
  File /usr/local/lib/python3.8/dist-packages/nxbt/web/app.py, line 9, in <module>
    from flask import Flask, render_template, request
  File /usr/local/lib/python3.8/dist-packages/flask/__init__.py, line 14, in <module>
    from jinja2 import escape
ImportError: cannot import name 'escape' from 'jinja2' (/usr/local/lib/python3.8/dist-packages/jinja2/__init__.py)

If you install Jinja2==3.0.3 you no longer have that specific error but then run into ImportError: cannot import name ‘json’ from itsdangerous which is also a Flask related issue requiring you to downgrade itsdangerous from 2.1.2 (at time of writing) to 2.0.1 and downgrade werkzeug from 2.1.1 to 2.0.2 before the webserver runs without issue.

@l4desu-mizu
Copy link

related to #61. (updating the dependencies to more recent flask versions works)

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

2 participants