Message1554

Author pragmar
Recipients
Date 2007-04-12.21:27:20
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
I was attempting to trap a parsing error and a fatal error somehow leaked through. Unsure what this means, but I figured best to post it. Thanks.

import xml.dom.minidom as md

# error not trapped in jython 2.2b1
try:
    xml = md.parseString('<malformed att=8>0</malformed>')
except Exception, e:
    print str(e)

# Traceback (innermost last):
#   File "<console>", line 2, in ?
#   File "C:\jython2.2b1\Lib\xml\dom\minidom.py", line 1933, in parseString
#   File "C:\jython2.2b1\Lib\xml\dom\minidom.py", line 1908, in _do_pulldom_parse
#   File "C:\jython2.2b1\Lib\xml\dom\pulldom.py", line 275, in _slurp
#   File "C:\jython2.2b1\Lib\xml\sax\drivers2\drv_javasax.py", line 141, in parse
#   File "C:\jython2.2b1\Lib\xml\sax\drivers2\drv_javasax.py", line 58, in fatalError
#   File "C:\jython2.2b1\Lib\xml\sax\handler.py", line 38, in fatalError
# SAXParseException: <unknown>:1:16: Open quote is expected for attribute "att" associated with an  element type  "malformed".

# w/o "Exception", jython 2.2b1 behaves.
try:
    xml = md.parseString('<malformed att=8>0</malformed>')
except:
    pass

#>>>
History
Date User Action Args
2008-02-20 17:17:47adminlinkissue1699556 messages
2008-02-20 17:17:47admincreate