xml.dom.minidom.parseString() doesn't accept Unicode.

Dale Strickland-Clark dale at riverhall.NOTHANKS.co.uk
Sat Oct 27 18:55:31 CEST 2001


Given that XML is very Unicode friendly, this seems a rather odd
limitation.

>>> import xml.dom.minidom
>>> dom = xml.dom.minidom.parseString(u'<node/>')
Traceback (most recent call last):
  File "<interactive input>", line 1, in ?
  File "c:\python21\lib\xml\dom\minidom.py", line 915, in parseString
    return _doparse(pulldom.parseString, args, kwargs)
  File "c:\python21\lib\xml\dom\minidom.py", line 901, in _doparse
    events = apply(func, args, kwargs)
  File "c:\python21\lib\xml\dom\pulldom.py", line 299, in parseString
    buf = StringIO(string)
TypeError: expected string, unicode found
>>> 
--
Dale Strickland-Clark
Riverhall Systems Ltd



More information about the Python-list mailing list