This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author hniksic
Recipients hniksic
Date 2008-05-16.12:20:26
SpamBayes Score 0.034222156
Marked as misclassified No
Message-id <1210940435.5.0.243679200602.issue2892@psf.upfronthosting.co.za>
In-reply-to
Content
In some cases it is unfortunate that any error in the XML chunk seen by
the buffer prevents the events generated before the error from being
delivered.  For example, in some cases valid XML is embedded in a larger
file or stream, and it is useful to be able to ignore text that follows
the root tag, if any.

The iterparse API and expat itself make this possible, but it doesn't
work because in case of a parsing exception, iterparse doesn't deliver
the events generated before the exception.  A simple change to iterparse
makes this possible, however.  I would like to share the change with you
for possible inclusion in a future release.  Note that this change
shouldn't affect the semantics of iterparse: the exception is still
delivered to the caller, the only difference is that the events
generated by expat before the exception are not forgotten.

I am attaching a diff between the current implementation of iterparse,
and a modified one that fixes this problem.
History
Date User Action Args
2008-05-16 12:20:36hniksicsetspambayes_score: 0.0342222 -> 0.034222156
recipients: + hniksic
2008-05-16 12:20:35hniksicsetspambayes_score: 0.0342222 -> 0.0342222
messageid: <1210940435.5.0.243679200602.issue2892@psf.upfronthosting.co.za>
2008-05-16 12:20:32hniksiclinkissue2892 messages
2008-05-16 12:20:30hniksiccreate