Terry J. Reedy <tjre...@udel.edu> added the comment:

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)

----------
nosy: +terry.reedy

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue12220>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to