Skip to content
This repository was archived by the owner on Mar 2, 2025. It is now read-only.

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

Open
psharma04 wants to merge 1 commit into
Cog-Creators:masterfrom
decoding-the-web:master
Open

Fix Flask issue when loading "escape" from Jinja2#73
psharma04 wants to merge 1 commit into
Cog-Creators:masterfrom
decoding-the-web:master

Conversation

@psharma04

Copy link
Copy Markdown

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.

@ltzmax ltzmax left a comment

Copy link
Copy Markdown

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
Copy Markdown
Contributor

somewhat duplicate of #69

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants