diff --git a/Lib/test/test_minidom.py b/Lib/test/test_minidom.py
index a6d309f7d9a..4ace1ebea9f 100644
--- a/Lib/test/test_minidom.py
+++ b/Lib/test/test_minidom.py
@@ -806,6 +806,14 @@ def testNormalize():
"testNormalize -- single empty node removed")
doc.unlink()
+def testBug1433694():
+ doc = parseString("t")
+ node = doc.documentElement
+ node.childNodes[1].nodeValue = ""
+ node.normalize()
+ confirm(node.childNodes[-1].nextSibling == None,
+ "Final child's .nextSibling should be None")
+
def testSiblings():
doc = parseString("text?")
root = doc.documentElement
diff --git a/Lib/xml/dom/minidom.py b/Lib/xml/dom/minidom.py
index 3a35781622f..b94a4c71bc2 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):
diff --git a/Misc/ACKS b/Misc/ACKS
index 8cb117f189e..c3a0942d292 100644
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -266,6 +266,7 @@ Shane Hathaway
Rycharde Hawkes
Jochen Hayek
Thomas Heller
+Malte Helmert
Lance Finn Helsten
Jonathan Hendry
James Henstridge
diff --git a/Misc/NEWS b/Misc/NEWS
index aec1f2ff424..4d40719e63a 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -15,6 +15,10 @@ Core and builtins
Library
-------
+- Bug #1433694: minidom's .normalize() failed to set .nextSibling for
+ last child element.
+
+
Extension Modules
-----------------