(Bah sorry, hit wrong key) I'm using lxml to parse Junoscript, which is a protocol that's a single infinite XML document, a bit like XMPP. It goes: <junoscript> <pdu>...</pdu> <pdu>...</pdu> <pdu>...</pdu> I've been using the construct: parser = XMLParser(target=SomeClass()) while getdata(): parser.feed(data) ...and handling the start/end event callbacks to dispatch PDUs. I've run into problems in production where, all of a sudden, parser events aren't being dispatched when I expected. The difference seems to be the chunking of the data differs in production, for reasons of timing/load. I found this thread: http://thread.gmane.org/gmane.comp.python.lxml.devel/4871/focus=4881 ...which suggests this is actually expected, and my understanding of the parser/target stuff is wrong - there's no guarantee that "end" will be called at any particular time. Is this correct? Since it's an infinite document, I can't call ".close()". Does lxml have any API I can use to handle this, and that also has a push interface? Note I cannot let lxml read or block, since it's being used in an async fashion. I need to push the data in, and get notifications of tag start/end events as soon as the full open/close has happened. If lxml doesn't have this, can anyone recommend another parser? Cheers, Phil