Closed
Description
See the script below. This works as expected.
# from defusedxml.ElementTree import fromstring
import xml.etree.ElementTree as ET
THE_XML = "<ListOfItems></ListOfItems>"
# xml = fromstring(THE_XML)
xml = ET.fromstring(THE_XML)
item = ET.Element('Item')
xml.append(item)
However it I swap for the version that uses defusedxml then I get this error:
Traceback (most recent call last):
File "c:\temp\defusing.py", line 7, in <module>
xml.append(item)
TypeError: append() argument must be xml.etree.ElementTree.Element, not Element
Is this caused by defusedxml or is this some subtle difference between the C and Python implementations of xml.etree.Elementree?
Metadata
Assignees
Labels
No labels