Edgewall Software

Ticket #290 (closed defect: fixed)

Opened 5 years ago

Last modified 5 years ago

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

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

Change History

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

patch with unit testing

Changed 5 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.

Changed 5 years ago by cmlenz

  • status changed from new to closed
  • resolution set to fixed
  • milestone changed from 0.6 to 0.5.2

Patch applied in [1000]. Thanks!

Changed 5 years ago by cmlenz

  • milestone changed from 0.5.2 to 0.6

Milestone 0.5.2 deleted

Add/Change #290 (FilterTransformation drops event following OUTSIDE sequence)

Author


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


Change Properties
<Author field>
Action
as closed
The resolution will be deleted. Next status will be 'reopened'
 
Note: See TracTickets for help on using tickets.