summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_minidom.py8
-rw-r--r--Lib/xml/dom/minidom.py2
2 files changed, 10 insertions, 0 deletions
diff --git a/Lib/test/test_minidom.py b/Lib/test/test_minidom.py
index 3058b30..fcc4c8f 100644
--- a/Lib/test/test_minidom.py
+++ b/Lib/test/test_minidom.py
@@ -791,6 +791,14 @@ class MinidomTest(unittest.TestCase):
"testNormalize -- single empty node removed")
doc.unlink()
+ def testBug1433694(self):
+ doc = parseString("<o><i/>t</o>")
+ node = doc.documentElement
+ node.childNodes[1].nodeValue = ""
+ node.normalize()
+ self.confirm(node.childNodes[-1].nextSibling == None,
+ "Final child's .nextSibling should be None")
+
def testSiblings(self):
doc = parseString("<doc><?pi?>text?<elm/></doc>")
root = doc.documentElement
diff --git a/Lib/xml/dom/minidom.py b/Lib/xml/dom/minidom.py
index 40e39f8..ae96033 100644
--- a/Lib/xml/dom/minidom.py
+++ b/Lib/xml/dom/minidom.py
@@ -203,6 +203,8 @@ class Node(xml.dom.Node):
L.append(child)
if child.nodeType == Node.ELEMENT_NODE:
child.normalize()
+ if L:
+ L[-1].nextSibling = None
self.childNodes[:] = L
def cloneNode(self, deep):