diff options
author | Georg Brandl <georg@python.org> | 2010-10-15 17:58:45 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2010-10-15 17:58:45 (GMT) |
commit | b9cd72a9f776bc2b517e22af444dc14268f50b41 (patch) | |
tree | 7792769589a501efcdedce5cd4356c5bcffa06aa /Lib/test/test_minidom.py | |
parent | d4460aaacdae40505a4645a73c021bfc810c9cb3 (diff) | |
download | cpython-b9cd72a9f776bc2b517e22af444dc14268f50b41.zip cpython-b9cd72a9f776bc2b517e22af444dc14268f50b41.tar.gz cpython-b9cd72a9f776bc2b517e22af444dc14268f50b41.tar.bz2 |
#5762: fix handling of empty namespace in minidom, which would result in AttributeError on toxml().
Diffstat (limited to 'Lib/test/test_minidom.py')
-rw-r--r-- | Lib/test/test_minidom.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/test/test_minidom.py b/Lib/test/test_minidom.py index d9d3be4..97668d3 100644 --- a/Lib/test/test_minidom.py +++ b/Lib/test/test_minidom.py @@ -1489,6 +1489,13 @@ class MinidomTest(unittest.TestCase): doc.appendChild(doc.createComment("foo--bar")) self.assertRaises(ValueError, doc.toxml) + def testEmptyXMLNSValue(self): + doc = parseString("<element xmlns=''>\n" + "<foo/>\n</element>") + doc2 = parseString(doc.toxml()) + self.confirm(doc2.namespaceURI == xml.dom.EMPTY_NAMESPACE) + + def test_main(): run_unittest(MinidomTest) |