aboutsummaryrefslogtreecommitdiff
path: root/Lib/xml/dom
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@redhat.com>2018-12-10 11:12:53 +0100
committerGitHub <noreply@github.com>2018-12-10 11:12:53 +0100
commit8e0418688906206fe59bd26344320c0fc026849e (patch)
treefcea9643fe407349cfc21aa9acdeace4c3afc264 /Lib/xml/dom
parentbpo-35445: Do not ignore memory errors when create posix.environ. (GH-11049) (diff)
downloadcpython-8e0418688906206fe59bd26344320c0fc026849e.tar.gz
cpython-8e0418688906206fe59bd26344320c0fc026849e.tar.bz2
cpython-8e0418688906206fe59bd26344320c0fc026849e.zip
bpo-35052: Fix handler on xml.dom.minidom.cloneNode() (GH-11061)
Fix xml.dom.minidom cloneNode() on a document with an entity: pass the correct arguments to the user data handler of an entity (fix an old copy/paste mistake). Bug spotted and fix proposed by Charalampos Stratakis, initial reproducer written by Petr Viktorin. Co-Authored-By: Charalampos Stratakis <cstratak@redhat.com> Co-Authored-By: Petr Viktorin <encukou@gmail.com>
Diffstat (limited to 'Lib/xml/dom')
-rw-r--r--Lib/xml/dom/minidom.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/xml/dom/minidom.py b/Lib/xml/dom/minidom.py
index 469c51735e0..43569ddcbea 100644
--- a/Lib/xml/dom/minidom.py
+++ b/Lib/xml/dom/minidom.py
@@ -1318,7 +1318,7 @@ class DocumentType(Identified, Childless, Node):
entity.encoding = e.encoding
entity.version = e.version
clone.entities._seq.append(entity)
- e._call_user_data_handler(operation, n, entity)
+ e._call_user_data_handler(operation, e, entity)
self._call_user_data_handler(operation, self, clone)
return clone
else:
@@ -1921,7 +1921,7 @@ def _clone_node(node, deep, newOwnerDocument):
entity.ownerDocument = newOwnerDocument
clone.entities._seq.append(entity)
if hasattr(e, '_call_user_data_handler'):
- e._call_user_data_handler(operation, n, entity)
+ e._call_user_data_handler(operation, e, entity)
else:
# Note the cloning of Document and DocumentType nodes is
# implementation specific. minidom handles those cases