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.

Author exarkun
Recipients exarkun
Date 2009-01-05.22:00:08
SpamBayes Score 0.009084193
Marked as misclassified No
Message-id <1231192810.66.0.263343969898.issue4851@psf.upfronthosting.co.za>
In-reply-to
Content
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'
History
Date User Action Args
2009-01-05 22:00:10exarkunsetrecipients: + exarkun
2009-01-05 22:00:10exarkunsetmessageid: <1231192810.66.0.263343969898.issue4851@psf.upfronthosting.co.za>
2009-01-05 22:00:10exarkunlinkissue4851 messages
2009-01-05 22:00:08exarkuncreate