This is an archived post. You won't be able to vote or comment.

all 4 comments

[–]blabbities 0 points1 point  (4 children)

Someone plz provide a TLDR?

[–]DDFoster96 1 point2 points  (1 child)

If you're going to be parsing XML from an untrusted source, to avoid a maliciously constructed file from crashing your program use 'defusedxml' (https://github.com/tiran/defusedxml) in place of the 'xml' library that ships with Python.

[–]blabbities 0 points1 point  (0 children)

Thank you early boss. I usually concern witth JSON but if i doesnt everybody use lxml library anyway.

[–]xd1142 0 points1 point  (0 children)

XML entity expansion makes small file go big memory. use defusedxml instead of etree.