mitsuhiko / minijinja

MiniJinja is a powerful but minimal dependency template engine for Rust compatible with Jinja/Jinja2
https://docs.rs/minijinja/
Apache License 2.0
1.67k stars 101 forks source link

Unable to set an undefined_behavior for a minijinja Enviroment in Python #560

Closed zdxerr closed 3 months ago

zdxerr commented 3 months ago

Description

I am unable to set an undefined_behavior for a minijinja Enviroment in Python.

I get RuntimeError: invalid value for undefined behavior if I use a string.

env = minijinja.Environment(
    keep_trailing_newline=keep_trailing_newline,
    undefined_behavior="Lenient",
)
mitsuhiko commented 3 months ago

The valid values for undefined_behavior in Python are "strict", "lenient", and "chainable". Note that they are all lowercase.