Edgewall Software

Opened 15 years ago

Closed 15 years ago

#383 closed defect (fixed)

Regression of unknown cause using groupby

Reported by: osimons Owned by: cmlenz
Priority: major Milestone: 0.6
Component: Expression evaluation Version: devel
Keywords: Cc:

Description

Got a test example that works using latest 0.5.x, but raises exception for latest 0.6dev (r1118):

from itertools import groupby
from genshi.template import MarkupTemplate

m = MarkupTemplate("""
<html xmlns:py="http://genshi.edgewall.org/">
  <body>
    <py:for each="i, j in groupby(test, key=lambda (x, y): x)">
      ${i} - ${j}
    </py:for>
  </body>
</html>
""", lookup='lenient')

test = [('a', 1), ('a', 2), ('b', 4)]

print m.generate(test=test, groupby=groupby)

It should output:

<html>
  <body>
      a - ('a', 1)('a', 2)
      b - ('b', 4)
  </body>
</html>

Instead it raises exception:

RuntimeError: maximum recursion depth exceeded while calling a Python object

From cmlenz on IRC, this seems to be the minimal test:

expr = Expression('groupby(test, key=lambda (x, y): y)')

Change History (2)

comment:1 Changed 15 years ago by cmlenz

  • Status changed from new to assigned

comment:2 Changed 15 years ago by cmlenz

  • Resolution set to fixed
  • Status changed from assigned to closed

Fixed in [1119]. Thanks for the report!

Note: See TracTickets for help on using tickets.