summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_xml_etree.py
diff options
context:
space:
mode:
authorEli Bendersky <eliben@gmail.com>2013-11-28 14:31:58 (GMT)
committerEli Bendersky <eliben@gmail.com>2013-11-28 14:31:58 (GMT)
commit5dd40e555b625c592b8391df84b36215204db4df (patch)
tree116f05746ecab2ff93071539ba8b926b682410c2 /Lib/test/test_xml_etree.py
parentc303cfdb8a1e23faf677262d7bc14c6ef6b2251a (diff)
downloadcpython-5dd40e555b625c592b8391df84b36215204db4df.zip
cpython-5dd40e555b625c592b8391df84b36215204db4df.tar.gz
cpython-5dd40e555b625c592b8391df84b36215204db4df.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 5496534..7bd8a2c 100644
--- a/Lib/test/test_xml_etree.py
+++ b/Lib/test/test_xml_etree.py
@@ -535,6 +535,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: