#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)
Change History (4)
Changed 16 years ago by Stephen Compall <stephen.compall@…>
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
923 923 for queue_event in flush(queue): 924 924 yield queue_event 925 925 if not stopped: 926 yield None, event926 yield mark, event 927 927 else: 928 928 yield mark, event 929 929 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.
patch with unit testing