Edgewall Software

Opened 17 years ago

Closed 17 years ago

#155 closed defect (fixed)

py:match handling does not invoke _exec, ignores EXEC events in (sub)template

Reported by: Andrew Sutherland <sombrero@…> Owned by: cmlenz
Priority: major Milestone: 0.5
Component: Template processing Version: devel
Keywords: Cc:

Description

In MarkupTemplate?._match in genshi/template/markup.py, the processing of the template sub-stream is passed through _flatten and _eval, but not _exec. Although it would make sense to avoid doing this so as to avoid confusing corruption of the enclosing context, _match has already pushed a new frame to hold the select() function so there is no danger.

As things stand, an arguably dubious example like the following would do what seems to be the wrong thing. We would expect the output to include "wakka wakka wakka", but instead we get "robo!".

<?python title="robo!" ?>
<html xmlns:py="http://genshi.edgewall.org/">
  <py:match path="p">

    <?python title="wakka wakka wakka" ?>

    ${title}<br />

  </py:match>

  <body><p>moot text</p></body>
</html>

Attachments (1)

markuptemplate-match-invoke-exec-r765.diff (1.1 KB) - added by Andrew Sutherland <sombrero@…> 17 years ago.
trivial patch with ugly whitespace to avoid col80 overflow

Download all attachments as: .zip

Change History (4)

Changed 17 years ago by Andrew Sutherland <sombrero@…>

trivial patch with ugly whitespace to avoid col80 overflow

comment:1 Changed 17 years ago by cmlenz

#154 has been marked as duplicate of this ticket.

comment:2 Changed 17 years ago by cmlenz

  • Milestone set to 0.5
  • Priority changed from minor to major
  • Status changed from new to assigned

comment:3 Changed 17 years ago by cmlenz

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

Patch applied in [766]. Thanks!

Note: See TracTickets for help on using tickets.