You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
xml.dom.minidom: cloneNode() and importNode() raise NamespaceErr for DOM Level 1 nodes #158978
Since gh-156665, Node.cloneNode(), Document.importNode() and Attr.cloneNode() raise xml.dom.NamespaceErr for DOM Level 1 nodes that have a colon in the name. Such nodes have no namespace and are created by createElement("svg:rect"), createAttribute("a:b"), setAttribute("xmlns:xsi", ...), or by parsing with namespace processing disabled.
cloneNode: NamespaceErr: cannot use the prefix 'xmlns' with an empty namespace
importNode: NamespaceErr: cannot use the prefix 'xmlns' with an empty namespace
Attr.cloneNode: NamespaceErr: cannot use the prefix 'a' with an empty namespace
_clone_node() creates the clones with createElementNS(), setAttributeNS() and createAttributeNS(), and these now reject a prefixed name when the namespace is empty. A plain setAttribute("xmlns", ...) fails the same way, because the xmlns attribute is only allowed in the XMLNS namespace.
CPython versions tested on:
CPython main branch (3.13 and 3.12 are not affected)
Activity