This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

作者 exarkun
收信人 exarkun
日期 2009-01-05.22:00:08
SpamBayes Score 0.009084193
Marked as misclassified
Message-id <1231192810.66.0.263343969898.issue4851@psf.upfronthosting.co.za>
In-reply-to
内容
It seems impossible to clone an Element created without a document:

  >>> Element('foo').cloneNode(False)
  Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
    File "/usr/lib/python2.5/xml/dom/minidom.py", line 211, in cloneNode
      return _clone_node(self, deep, self.ownerDocument or self)
    File "/usr/lib/python2.5/xml/dom/minidom.py", line 1814, in _clone_node
      if node.ownerDocument.isSameNode(newOwnerDocument):
  AttributeError: 'NoneType' object has no attribute 'isSameNode'

The documentation claims that cloneNode was fixed for releases
"subsequent" to 2.0, but this doesn't appear to be true.

http://docs.python.org/library/xml.dom.minidom.html#xml.dom.minidom.Node.cloneNode

A similar issue occurs when attempting to import a node into a document
(something I tried as a work-around for this failure):

  >>> d.importNode(e, False)
  Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
    File "/usr/lib/python2.5/xml/dom/minidom.py", line 1737, in importNode
      return _clone_node(node, deep, self)
    File "/usr/lib/python2.5/xml/dom/minidom.py", line 1814, in _clone_node
      if node.ownerDocument.isSameNode(newOwnerDocument):
  AttributeError: 'NoneType' object has no attribute 'isSameNode'
历史
日期 用户 动作 参数
2009-01-05 22:00:10exarkun修改recipients: + exarkun
2009-01-05 22:00:10exarkun修改messageid: <1231192810.66.0.263343969898.issue4851@psf.upfronthosting.co.za>
2009-01-05 22:00:10exarkun链接issue4851 messages
2009-01-05 22:00:08exarkun创建