Python minidom上的MemoryError

时间:2012-02-11 16:48:29

标签: python minidom

我通过MemoryError解析XML时遇到了一个奇怪的minidom(在服务器上运行,文件路径已更改):

Traceback (most recent call last):
  File "python.py", line 19, in <module>
    xmldoc = minidom.parseString(unicode(data,errors='ignore'))
  File "/usr/lib/python2.6/xml/dom/minidom.py", line 1928, in parseString
    return expatbuilder.parseString(string)
  File "/usr/lib/python2.6/xml/dom/expatbuilder.py", line 940, in parseString
    return builder.parseString(string)
  File "/usr/lib/python2.6/xml/dom/expatbuilder.py", line 223, in parseString
    parser.Parse(string, True)
  File "/usr/lib/python2.6/xml/dom/expatbuilder.py", line 753, in start_element_handler
    _append_child(self.curNode, node)
  File "/usr/lib/python2.6/xml/dom/minidom.py", line 287, in _append_child
    last.__dict__["nextSibling"] = node
MemoryError

我正在解析的xml-feed非常庞大,所以这可能就是问题所在。但该怎么办呢?

0 个答案:

没有答案