Edgewall Software

Opened 7 years ago

Closed 7 years ago

Last modified 6 years ago

#290 closed defect (fixed)

FilterTransformation drops event following OUTSIDE sequence

Reported by: Stephen Compall <stephen.compall@…> Owned by: cmlenz
Priority: major Milestone: 0.6
Component: General Version: 0.5
Keywords: patch Cc:


As seen with:

>>> from genshi.filters.transform import Transformer
>>> from genshi.input import XML
>>> print XML('<a>b</a>') | Transformer('//text()').filter(lambda x: x).trace()
(None, ('START', (QName(u'a'), Attrs()), (None, 1, 0)))
('OUTSIDE', ('TEXT', u'b', (None, 1, 3)))

Perhaps this has something to do with the unused stopped var in FilterTransformation.__call__?

Attachments (1)

genshi-290.diff (1.5 KB) - added by Stephen Compall <stephen.compall@…> 7 years ago.
patch with unit testing

Download all attachments as: .zip

Change History (4)

Changed 7 years ago by Stephen Compall <stephen.compall@…>

patch with unit testing

comment:1 Changed 7 years ago by Stephen Compall <stephen.compall@…>

  • Keywords patch added

The attached includes a test case and fix for this bug, made against r999. Incidentally, it includes this slightly related hunk (now that the path is actually followed):

  • genshi/filters/transform.py

    923923                for queue_event in flush(queue):
    924924                    yield queue_event
    925925                if not stopped:
    926                     yield None, event
     926                    yield mark, event
    927927            else:
    928928                yield mark, event
    929929        for queue_event in flush(queue):

Since the real mark is available and such.

comment:2 Changed 7 years ago by cmlenz

  • Milestone changed from 0.6 to 0.5.2
  • Resolution set to fixed
  • Status changed from new to closed

Patch applied in [1000]. Thanks!

comment:3 Changed 6 years ago by cmlenz

  • Milestone changed from 0.5.2 to 0.6

Milestone 0.5.2 deleted

Add Comment

Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain cmlenz.
The resolution will be deleted. Next status will be 'reopened'.

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.