Author ocean-city
Recipients ocean-city, roland
Date 2008-10-10.21:26:37
SpamBayes Score 6.30351e-09
Marked as misclassified No
Message-id <1223673999.05.0.675413858535.issue4100@psf.upfronthosting.co.za>
In-reply-to
Content
Minimum script to reproduce this issue is "bug.py" I've attached.
And I think this issue can be fixed with
"fix_cross_boundary_on_ElementTree.patch". I'll attach the test case for
this issue as "test.py". (I wanted to intergrate test into
test_xml_etree_c.py, but it uses doctest which I don't know about)

/////////////////////////
// Cause of issue

TreeBuilder#start() and TreeBuilder#end() are handlers driven by
self._parser.feed(data) in iterparse.next(), and iterparse stores
elements returned by these functions.

But element is not initialized at the moment. No one can determine
element.text when start tag is found, and element.tail when end tag is
found vise versa. We can say "the element is initialized" when
encountered next element or TreeBuilder is closed.

So, iterparse's _events queue may contain uninitialized elements, so my
patch waits until the element will be initialized.
History
Date User Action Args
2008-10-10 21:26:39ocean-citysetrecipients: + ocean-city, roland
2008-10-10 21:26:39ocean-citysetmessageid: <1223673999.05.0.675413858535.issue4100@psf.upfronthosting.co.za>
2008-10-10 21:26:37ocean-citylinkissue4100 messages
2008-10-10 21:26:37ocean-citycreate