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

Fix Flask issue when loading "escape" from Jinja2 #73

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

psharma04
Copy link

Type

Bug Fix

Description of the changes

As described in #71 Flask is currently trying to import 'escape' from Jinja2, which removed the escape function in 3.1.0 (released March 24, 2022).

This Pull Request locks Jinja2 to pre-3.1.0 versions to prevent this issue, and adds werkzeug 2.0.3 which is required by older versions of Jinja2.

Copy link

@ltzmax ltzmax left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello.
I believe you didn't test this 100%?
This didn't really solve the issue after several testing today. but bumping flask to 2.1.0 fixed it since flask V1.X.X uses the escape module from Jinja, and what i found out over my testing and googling into release notes was however recently support for the escape module was dropped in newer versions of Jinja which means that jinja version 3.1.0 seems to be needing flask version 2.1.0 to work, since that's the only version i got jinja 3.1.0 to work with.

Solution other than bumping versions

Bumping versions is indeed the easist way, you can also import from markupsafe import escape to fix the issue as well. It's stated in jinja's release notes.

@fixator10
Copy link
Contributor

somewhat duplicate of #69

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

Successfully merging this pull request may close these issues.

4 participants