This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author terry.reedy
Recipients hfischer, terry.reedy
Date 2011-06-03.22:58:04
SpamBayes Score 2.5811214e-10
Marked as misclassified No
Message-id <1307141885.13.0.942056269476.issue12220@psf.upfronthosting.co.za>
In-reply-to
Content
SyntaxErrors refer to Python syntax errors; they are raised during parsing of *Python* code. An error in the value given to a Python sensibly raises a ValueError unless a module does something more specific.

From the xml.dom doc
"DOM Level 2 recommendation defines a single exception, DOMException"
One subclass is "exception xml.dom.SyntaxErr -- Raised when an invalid or illegal string is specified." which would be appropriate here.

However, "The xml.dom.minidom module is essentially a DOM 1.0-compatible DOM with some DOM 2 features (primarily namespace features)." In particular, "DOMException is currently not supported in xml.dom.minidom. Instead, xml.dom.minidom uses standard Python exceptions such as TypeError and AttributeError." or ValueError.

An improved error report could go into 2.7/3.2.
A change in minidom spec to use DOMException would be a feature request for 3.3 or later (and a bigger project -- code welcome). For the moment, I am assuming that you are requesting the former.

A Python exception is not a crash. A crash is a Segmentation Fault (*nix) or 'Your program stopped unexpectedly' (Windows)
History
Date User Action Args
2011-06-03 22:58:05terry.reedysetrecipients: + terry.reedy, hfischer
2011-06-03 22:58:05terry.reedysetmessageid: <1307141885.13.0.942056269476.issue12220@psf.upfronthosting.co.za>
2011-06-03 22:58:04terry.reedylinkissue12220 messages
2011-06-03 22:58:04terry.reedycreate