summaryrefslogtreecommitdiffstats
path: root/Lib/xml/dom/minidom.py
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@redhat.com>2018-12-10 10:53:09 (GMT)
committerGitHub <noreply@github.com>2018-12-10 10:53:09 (GMT)
commit3fd975583b8e43d8dc23c83d699cd10b1fee6f7f (patch)
tree0fdebc86ad34abbda206ed9b2fa844edac5d193e /Lib/xml/dom/minidom.py
parentf2d2cb12f2d3bd68a13c4098311e725f776768ad (diff)
downloadcpython-3fd975583b8e43d8dc23c83d699cd10b1fee6f7f.zip
cpython-3fd975583b8e43d8dc23c83d699cd10b1fee6f7f.tar.gz
cpython-3fd975583b8e43d8dc23c83d699cd10b1fee6f7f.tar.bz2
bpo-35052: Fix handler on xml.dom.minidom.cloneNode() (GH-11061) (GH-11067)
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> (cherry picked from commit 8e0418688906206fe59bd26344320c0fc026849e)
Diffstat (limited to 'Lib/xml/dom/minidom.py')
-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 a5d813f..24957ea 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