You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Traceback (most recent call last):
File "/home/bart/tmp/jinja2-async-namespacce/venv/lib/python3.8/site-packages/jinja2/utils.py", line 699, in __getattribute__returnself.__attrs[name]
KeyError: '__class__'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "namespace.py", line 12, in <module>
asyncio.get_event_loop().run_until_complete(main())
File "/usr/lib/python3.8/asyncio/base_events.py", line 616, in run_until_completereturn future.result()
File "namespace.py", line 10, in mainawait environment.from_string(template).render_async()
File "/home/bart/tmp/jinja2-async-namespacce/venv/lib/python3.8/site-packages/jinja2/asyncsupport.py", line 65, in render_asyncreturnself.environment.handle_exception()
File "/home/bart/tmp/jinja2-async-namespacce/venv/lib/python3.8/site-packages/jinja2/environment.py", line 832, in handle_exception
reraise(*rewrite_traceback_stack(source=source))
File "/home/bart/tmp/jinja2-async-namespacce/venv/lib/python3.8/site-packages/jinja2/_compat.py", line 28, in reraiseraise value.with_traceback(tb)
File "/home/bart/tmp/jinja2-async-namespacce/venv/lib/python3.8/site-packages/jinja2/asyncsupport.py", line 25, in concat_asyncawait collect()
File "/home/bart/tmp/jinja2-async-namespacce/venv/lib/python3.8/site-packages/jinja2/asyncsupport.py", line 22, in collectasyncfor event in async_gen:
File "<template>", line 1, in top-level template code
File "/home/bart/tmp/jinja2-async-namespacce/venv/lib/python3.8/site-packages/jinja2/asyncsupport.py", line 173, in auto_awaitif inspect.isawaitable(value):
File "/usr/lib/python3.8/inspect.py", line 234, in isawaitableisinstance(object, collections.abc.Awaitable))
File "/home/bart/tmp/jinja2-async-namespacce/venv/lib/python3.8/abc.py", line 98, in __instancecheck__return _abc_instancecheck(cls, instance)
File "/home/bart/tmp/jinja2-async-namespacce/venv/lib/python3.8/site-packages/jinja2/utils.py", line 701, in __getattribute__raiseAttributeError(name)
AttributeError: __class__
Your Environment
Python version: Python 3.8
Jinja version: 2.11.1
The text was updated successfully, but these errors were encountered:
When asynchronously rendering templates that make use of namespaces, rendering fails on
AttributeError: __class__
.Expected Behavior
No error is raised.
Actual Behavior
Using namespaces when rendering templates asynchronously fails on the
isawaitable()
check performed onNamespace
.Template Code
Reproduction:
Full Traceback
Your Environment
The text was updated successfully, but these errors were encountered: