template cache container uses a creation callable with stale context

Issue #87 resolved
Michael Bayer
repo owner created an issue

this because the `Container` in cache _get_container() is held in a dictionary, and the cache callable rendered in the template accesses the current context. The change would have to involve the cache callable getting at the current context, or perhaps _get_container() updating the container with the current callable.

t = Template(""" ${foo()} <%def name="foo()" cached="True" cache_timeout="2"> <% print "context", context %> foo </%def> """)

import time x1 = t.render() time.sleep(3) x2 = t.render()

Comments (1)

  1. Log in to comment