Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jinja2 Environment option "lstrip_blocks" produces TypeError

I am using Ubuntu 12.04, python 3.2.3 and jinja2 2.6-1.

When passing the option lstrip_blocks to the Environment as follows, I get this error

"**TypeError: \__init__() got an unexpected keyword argument 'lstrip_blocks'**"

from jinja2 import Environment, PackageLoader
env = Environment(loader=PackageLoader('jinja2_hello','.'),lstrip_blocks=True)
template = env.get_template('template_hello.html')
output = template.render()
print(output)

The template template_hello.html contains only:

hello

The other option 'trim_blocks`, alone, works perfectly.

Would you have any suggestions to solve this. I haven't been able to fix it. Thanks

like image 982
RolPasto Avatar asked Jan 12 '23 22:01

RolPasto


1 Answers

The lstrip_blocks option was only added in Jinja 2.7.

like image 129
djc Avatar answered Jan 18 '23 23:01

djc