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

2.16: Do not ignore SyntaxError from jinja2.Environment.from_string (#82607) #82614

Merged
merged 1 commit into from
Feb 14, 2024

Commits on Jan 29, 2024

  1. Do not ignore SyntaxError from jinja2.Environment.from_string (ansibl…

    …e#82607)
    
    Jinja may generate an invalid Python source code from a template. Trying
    to compile such source code into a Python code object results in
    SyntaxError being thrown. An example of such a template is providing the
    same keyword argument into a lookup twice, resulting in:
    `SyntaxError: keyword argument repeated`.
    
    Since `jinja2.exceptions.TemplateSyntaxError` does not cover such a
    case, as it is not a Jinja parsing error, we need to catch SyntaxError
    explicitly ourselves.
    
    Fixes ansible#82606
    
    (cherry picked from commit 6d34eb8)
    mkrizek committed Jan 29, 2024
    Configuration menu
    Copy the full SHA
    05e413f View commit details
    Browse the repository at this point in the history