Edgewall Software

Opened 16 years ago

Closed 16 years ago

Last modified 15 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:

Description

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)))
<a>b

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@…> 16 years ago.
patch with unit testing

Download all attachments as: .zip

Change History (4)

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

patch with unit testing

comment:1 Changed 16 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 16 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 15 years ago by cmlenz

  • Milestone changed from 0.5.2 to 0.6

Milestone 0.5.2 deleted

Note: See TracTickets for help on using tickets.