summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_xml_etree.py
diff options
context:
space:
mode:
authorEli Bendersky <eliben@gmail.com>2013-11-28 14:35:40 (GMT)
committerEli Bendersky <eliben@gmail.com>2013-11-28 14:35:40 (GMT)
commit8148164353b935ce7a1716d82eca461e0ca6ed8f (patch)
tree5cf162b1aecf6bc508504e1c800866feff7d6fe5 /Lib/test/test_xml_etree.py
parent470fba1f9f3e3296df675fdd7d37102065cfb6ae (diff)
parent4b79518f83fa6c4dadd69326276032d74c8e3df7 (diff)
downloadcpython-8148164353b935ce7a1716d82eca461e0ca6ed8f.zip
cpython-8148164353b935ce7a1716d82eca461e0ca6ed8f.tar.gz
cpython-8148164353b935ce7a1716d82eca461e0ca6ed8f.tar.bz2
Issue #19815: Fix segfault when parsing empty namespace declaration.
Based on patches by Christian Heimes and Vajrasky Kok
Diffstat (limited to 'Lib/test/test_xml_etree.py')
-rw-r--r--Lib/test/test_xml_etree.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/test/test_xml_etree.py b/Lib/test/test_xml_etree.py
index 5351b0b..89971f1 100644
--- a/Lib/test/test_xml_etree.py
+++ b/Lib/test/test_xml_etree.py
@@ -526,6 +526,11 @@ class ElementTreeTest(unittest.TestCase):
('end-ns', None),
])
+ events = ('start-ns', 'end-ns')
+ context = iterparse(io.StringIO(r"<root xmlns=''/>"), events)
+ res = [action for action, elem in context]
+ self.assertEqual(res, ['start-ns', 'end-ns'])
+
events = ("start", "end", "bogus")
with self.assertRaises(ValueError) as cm:
with open(SIMPLE_XMLFILE, "rb") as f: