[New-bugs-announce] [issue12220] minidom xmlns not handling spaces in xmlns attribute value field

Herm Fischer report at bugs.python.org
Mon May 30 23:06:13 CEST 2011


New submission from Herm Fischer <fischer at markv.com>:

Minidom raises an exception if there's a space anywhere in the URI of an xmlns, but it is legal (but terrible practice) to have spaces in URIs.  I think this should work or politely raise a syntax error.  E.g., this fails:  xmlns:abc="http:abc.com/de f g/hi/j k".

The attachment xml file from an end user has this xmlns:

  xmlns:verrels=" http://xbrl.org/2010/versioning-relationship-sets"

which causes minidom to raise a ValueError exception, instead of a sensible syntax error message.  

The relevant python code is expabuilder.py, method _parse_ns_name, which does not have an elif for len(parts) != 2 (to raise a syntax error which identifies the bad construct).

----------
components: XML
files: test.xml
messages: 137329
nosy: hfischer
priority: normal
severity: normal
status: open
title: minidom xmlns not handling spaces in xmlns attribute value field
type: crash
versions: Python 3.2
Added file: http://bugs.python.org/file22203/test.xml

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue12220>
_______________________________________


More information about the New-bugs-announce mailing list