summaryrefslogtreecommitdiffstats
path: root/Lib/xml/dom
diff options
context:
space:
mode:
authorR David Murray <rdmurray@bitdance.com>2014-04-20 04:46:05 (GMT)
committerR David Murray <rdmurray@bitdance.com>2014-04-20 04:46:05 (GMT)
commit9077d24d7f85e09e53def11b2beeaf40749e2464 (patch)
treee9ecb49bfa01f919f9e1f7d0d2a517aba4bed6c4 /Lib/xml/dom
parent09ae544ea3a6e33418ec8ab0100fc8288eef6d13 (diff)
downloadcpython-9077d24d7f85e09e53def11b2beeaf40749e2464.zip
cpython-9077d24d7f85e09e53def11b2beeaf40749e2464.tar.gz
cpython-9077d24d7f85e09e53def11b2beeaf40749e2464.tar.bz2
#12220: improve minidom error when URI contains spaces.
Fix by 'amathew', test by Marek Stepniowski.
Diffstat (limited to 'Lib/xml/dom')
-rw-r--r--Lib/xml/dom/expatbuilder.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/Lib/xml/dom/expatbuilder.py b/Lib/xml/dom/expatbuilder.py
index 81e2df7..8976144 100644
--- a/Lib/xml/dom/expatbuilder.py
+++ b/Lib/xml/dom/expatbuilder.py
@@ -121,10 +121,12 @@ def _parse_ns_name(builder, name):
qname = "%s:%s" % (prefix, localname)
qname = intern(qname, qname)
localname = intern(localname, localname)
- else:
+ elif len(parts) == 2:
uri, localname = parts
prefix = EMPTY_PREFIX
qname = localname = intern(localname, localname)
+ else:
+ raise ValueError("Unsupported syntax: spaces in URIs not supported: %r" % name)
return intern(uri, uri), localname, prefix, qname