#5350 ImportError: cannot import name 'escape' from 'jinja2'
Closed: Fixed 2 years ago by ngompa. Opened 2 years ago by mzch.

I got ImportError: cannot import name 'escape' from 'jinja2' in 0cd8e1f.
I edited filters.py as below in order to fix this error:

--- filters.py.bak      2022-11-30 03:29:54.308995338 +0900
+++ filters.py  2022-11-30 03:30:27.065294274 +0900
@@ -27,7 +27,8 @@
 import pygit2

 from six.moves.urllib.parse import urlparse, parse_qsl
-from jinja2 import escape
+# from jinja2 import escape
+from markupsafe import escape

 import pagure.exceptions
 import pagure.lib.query

See https://stackoverflow.com/questions/71718167/importerror-cannot-import-name-escape-from-jinja2


Metadata Update from @wombelix:
- Issue assigned to wombelix

2 years ago

Log in to comment on this ticket.

Metadata
Related Pull Requests
  • #5478 Merged 4 months ago
  • #5360 Merged 2 years ago