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 2.11 broken against markupsafe==2.1.0 #1599

Closed
RouquinBlanc opened this issue Feb 19, 2022 · 3 comments
Closed

Jinja 2.11 broken against markupsafe==2.1.0 #1599

RouquinBlanc opened this issue Feb 19, 2022 · 3 comments

Comments

@RouquinBlanc
Copy link

Environment:

  • Python version: 3.9
  • Jinja version: 2.11.3

Hi,

Yesterday, markupsafe was bumped to 2.1.0 but it breaks jinja 2.11.3 because of the use of soft_unicode which was just removed...

Is there a plan to continue supporting the 2.11 branch for a while still? In which case it would be nice to either:

  • limit the version of markupsafe to be used to pre-2.1.0
  • or on the contrary, fix the use of that function toward soft_str?

I've seen this on some of our legacy code, but I'm pretty sure many people have legacy code and would rather not update in a rush 😅

$ python
Python 3.9.5 (default, May 25 2021, 18:01:27)
[Clang 12.0.0 (clang-1200.0.32.29)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from jinja2 import Environment
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/jmartin/workspace/nidar-apps/apps/nidar-l3-proxy/venv/lib/python3.9/site-packages/jinja2/__init__.py", line 12, in <module>
    from .environment import Environment
  File "/Users/jmartin/workspace/nidar-apps/apps/nidar-l3-proxy/venv/lib/python3.9/site-packages/jinja2/environment.py", line 25, in <module>
    from .defaults import BLOCK_END_STRING
  File "/Users/jmartin/workspace/nidar-apps/apps/nidar-l3-proxy/venv/lib/python3.9/site-packages/jinja2/defaults.py", line 3, in <module>
    from .filters import FILTERS as DEFAULT_FILTERS  # noqa: F401
  File "/Users/jmartin/workspace/nidar-apps/apps/nidar-l3-proxy/venv/lib/python3.9/site-packages/jinja2/filters.py", line 13, in <module>
    from markupsafe import soft_unicode
ImportError: cannot import name 'soft_unicode' from 'markupsafe' (/Users/jmartin/workspace/nidar-apps/apps/nidar-l3-proxy/venv/lib/python3.9/site-packages/markupsafe/__init__.py)

Thanks

@ThiefMaster
Copy link
Member

ThiefMaster commented Feb 19, 2022

You may want to look at the pinned issue (or large amount of closed issues) before opening your own in the future ;)
#1585

TL;DR: Don't use an outdated Jinja version or pin all dependencies.

@RouquinBlanc
Copy link
Author

oops sorry

@davidism
Copy link
Member

Duplicate of #1585

You are using an unsupported version of Jinja, please update to the latest version if possible. 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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 6, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants