#12220: improve minidom error when URI contains spaces.

Fix by 'amathew', test by Marek Stepniowski.
This commit is contained in:
R David Murray 2014-04-20 00:46:05 -04:00
parent 09ae544ea3
commit 9077d24d7f
4 changed files with 11 additions and 1 deletions

View file

@ -1518,6 +1518,10 @@ class MinidomTest(unittest.TestCase):
doc2 = parseString(doc.toxml())
self.confirm(doc2.namespaceURI == xml.dom.EMPTY_NAMESPACE)
def testExceptionOnSpacesInXMLNSValue(self):
with self.assertRaisesRegex(ValueError, 'Unsupported syntax'):
parseString('<element xmlns:abc="http:abc.com/de f g/hi/j k"><abc:foo /></element>')
def testDocRemoveChild(self):
doc = parse(tstfile)
title_tag = doc.documentElement.getElementsByTagName("TITLE")[0]