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

HTML exporter DeprecationWarning: 'jinja2.Markup' is deprecated and will be removed in Jinja 3.1 #1605

Closed
sjdemartini opened this issue Jul 16, 2021 · 1 comment

Comments

@sjdemartini
Copy link

sjdemartini commented Jul 16, 2021

When using the HTML exporter, the following warning will show up:

   /.../venv/lib/python3.8/site-packages/nbconvert/exporters/html.py:125: DeprecationWarning: 'jinja2.Markup' is deprecated and will be removed in Jinja 3.1. Import 'markupsafe.Markup' instead.
     return jinja2.Markup(code)

This was updated in jinja2 here pallets/jinja#1391. Semi-related to #1568 (another Jinja deprecation warning).

jinja2.Markup is used in a few places in the HTML exporter:

return jinja2.Markup(code)

return jinja2.Markup(code)

return jinja2.Markup(src)

It seems it needs to be replaced with an import from the markupsafe package instead of jinja2.

Nbconvert version: 6.0.7 (deprecated class usage appears to be present on master as shown above, so will presumably show up with 6.1.0 as well)

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