[issue29050] xml.etree.ElementTree in Python 3.6 is incompatible with defusedxml

Serhiy Storchaka report at bugs.python.org
Thu Dec 22 14:01:15 EST 2016


Serhiy Storchaka added the comment:

I think this can be fixed from defusedxml side:

    def iterparse(source, events=None, parser=None, forbid_dtd=False,
                  forbid_entities=True, forbid_external=True):
        if not parser:
            parser = DefusedXMLParser(target=_TreeBuilder(),
                                      forbid_dtd=forbid_dtd,
                                      forbid_entities=forbid_entities,
                                      forbid_external=forbid_external)
        return xml.etree.ElementTree.iterparse(source, events, parser)

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue29050>
_______________________________________


More information about the Python-bugs-list mailing list