five.pt: combination of tal:condition and tal:attribute causes 'UnboundLocalError: local variable '__default_XXXXXXX' referenced before assignment

Bug #848200 reported by LeoRochael
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Chamelon ZPT
Fix Committed
Undecided
Unassigned

Bug Description

The following source:

<tal:block>
  <tag tal:condition="False"
       tal:attributes="attrib string:false" />
  <tag tal:condition="True"
       tal:attributes="attrib string:true" />
</tal:block>

Causes this error:

Traceback (most recent call last):
  [...]
  File "src/five.pt/src/five/pt/patches.py", line 128, in __call__
    result = self.template.render(**context)
  File "src/five.pt/eggs/z3c.pt-2.1.3-py2.6.egg/z3c/pt/pagetemplate.py", line 147, in render
    return base_renderer(**context)
  File "src/five.pt/develop/Chameleon/src/chameleon/zpt/template.py", line 211, in render
    return super(PageTemplate, self).render(**vars)
  File "src/five.pt/develop/Chameleon/src/chameleon/template.py", line 188, in render
    self._render(stream, econtext, rcontext)
  File "91b40fe496271d2b65e1ff5835bdf07ac8f59b53.py", line 113, in render
UnboundLocalError: local variable '__default_53515600' referenced before assignment

I could reproduce it with a TTW ZPT, but not with pure Chameleon (i.e. adding the above source to src/chameleon/tests/inputs and the the correct output to src/chameleon/tests/outputs worked).

Tags: five.pt
Revision history for this message
LeoRochael (leorochael) wrote :

This bug is fixed by pinning:

sourcecodegen = 0.6.14

This minimum dep has been committed to five.pt in setup.py, but meanwhile users of five.pt can install it (or pin it in buildout) by themselves.

Changed in chameleon.zpt:
status: New → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.