【发布时间】:2020-03-10 15:29:27
【问题描述】:
我正在尝试运行以下 python 命令:
$ python stack.py <file_name> 我位于包含 stack.py 文件的正确文件夹中。
但是,我收到以下错误,我不确定如何解决它或为什么会出现这种情况。
我尝试升级 jinja $ pip install Jinja2,但没有成功。
我还查看了 stack_error_vals.json 和 stack_error_template.j2,但其中没有有用的信息。
关于如何解决这个问题以便我的 python 命令再次成功的任何想法?
File "stack.py", line 514, in proc_jinja_templates
output = env.render(vals)
File "C:\Users\jthomas\AppData\Local\Programs\Python\Python37-32\lib\site-packages\jinja2\asyncsupport.py", line 76, in render
return original_render(self, *args, **kwargs)
File "C:\Users\jthomas\AppData\Local\Programs\Python\Python37-32\lib\site-packages\jinja2\environment.py", line 1008, in render
return self.environment.handle_exception(exc_info, True)
File "C:\Users\jthomas\AppData\Local\Programs\Python\Python37-32\lib\site-packages\jinja2\environment.py", line 780, in handle_exception
reraise(exc_type, exc_value, tb)
File "C:\Users\jthomas\AppData\Local\Programs\Python\Python37-32\lib\site-packages\jinja2\_compat.py", line 37, in reraise
raise value.with_traceback(tb)
File "<template>", line 16, in top-level template code
File "C:/carbon\modules\templates\bridge\configs\config.xml.j2", line 27, in top-level template code
{%- if v.required or ((v.configdatatype == 'Bool' and v.value in (true,false)) or (v.configdatatype == 'String' and v.value and 'changeme' not in v.value.lower())) -%}
jinja2.exceptions.UndefinedError: 'int object' has no attribute 'lower'
Writing stack_error_vals.json and stack_error_template.j2 for review
【问题讨论】:
标签: python python-3.x git jinja2 git-bash