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

select_autoescape default value for default_for_string should be False #1890

Open
clavedeluna opened this issue Sep 26, 2023 · 0 comments
Open

Comments

@clavedeluna
Copy link

According to jinja's select_autoescape documentation

The select_autoescape() function returns a function that works roughly like this:

def autoescape(template_name):
if template_name is None:
return False

Furthermore, the docs makes it clear that jinja's default autoescape is still False. So, If I setup autoescape like this:

from jinja2 import Environment, select_autoescape
env = Environment(autoescape=select_autoescape())

I would expect autoescape to end up as False

However, in the code here when template_name is None, it returns the default value of default_for_string, which at this time is True.

Should default_for_string not be False, just like default?

Environment:

  • Python version:
  • Jinja version: 3.0.x
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

1 participant