Comment 4 for bug 1185701

Revision history for this message
Pi Delport (pi-delport) wrote :

For the problem of raising XMLSyntaxError on the next iteration right after the document root closes, the following workaround seems to step around the problem:

    for (state, elem) in etree.iterparse(f):
        [...process...]

        # Work around bug #1185701 by bailing out after the end of the document root.
        if elem.getparent() is None:
            break