memory leak parsing xml using xml.dom.minidom

前端 未结 1 2048
旧巷少年郎
旧巷少年郎 2021-01-15 20:06

I\'m using xml.dom.minidom to parse xml files, somewhat like this:

import xml.dom.minidom as dom

file= open(\'file.xml\')
doc= dom.parse(file)
# SNIP
doc.un         


        
相关标签:
1条回答
  • 2021-01-15 20:17

    I am also observing the same issues with minidom! And we are not alone. See for example here.

    There it is suggested to use an other XML implementations with python binding like

    • xml.etree.ElementTree: alternative implementation in the Python standard library
    • libxml2: XML C parser with python bindings
    • lxml: a more pythonic binding to libxml2
    0 讨论(0)
提交回复
热议问题