3 ms·
In case anyone missed dalke's comment below: If you use Python, use defusedxml: https://pypi.python.org/pypi/defusedxml https://pypi.python.org/pypi/defusedxm
by acdha 12y ago
In case anyone missed dalke's comment below:
If you use Python, use defusedxml:
https://pypi.python.org/pypi/defusedxml https://pypi.python.org/pypi/defusedxml
It's a drop-in replacement for the stdlib XML parsers and lxml which makes it trivial to import an instance with secure defaults – to quote the docs:
Instead of:
>>> from xml.etree.ElementTree import parse
>>> et = parse(xmlfile)
alter code to:
>>> from defusedxml.ElementTree import parse
>>> et = parse(xmlfile)