Skip to content

Composed def leads to infinite recursion #186

Closed
@sqlalchemy-bot

Description

@sqlalchemy-bot

Migrated issue, originally created by Anonymous

Okay, this time I'm almost positive this counts as a bug, as opposed to me doing something wierd.

This leads to a RuntimeError: maximum recursion depth exceeded.

from mako.template import Template

tmpl = Template("""
<%def name="f()">${caller.body()}</%def>
<%def name="g()">${caller.body()}</%def>

<%def name="fg()">
  <%self:f><%self:g>${caller.body()}</%self:g></%self:f>
</%def>

<%self:fg>body</%self:fg>
""")

print tmpl.render()

When I have a chance, I'll see if I can come up with a patch.


Attachments: ticket186.patch

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions