[XML-SIG] Noisier error handling all 'round?

Paul Prescod paul@prescod.net
Thu, 23 Mar 2000 20:06:37 -0800


It doesn't matter much one way or the other because the SAX interface
should be more often used. The speed freaks who code directly to Expat
(it may not buy much at all, actually...) can read the documentation or
sample code or whatever.

But that begs the question of what saxlib does and it does NOT, by
default raise an exception. It should. For all parsers the driver should
set it up so that the "default error handler" raises an exception.

 Paul Prescod

"A.M. Kuchling" wrote:
> 
> I'm going over the PyExpat module to be sure it's ready for inclusion
> in the Python CVS tree.  One point about its error handling is
> disquieting; it hews very closely to the C Expat interface, so that a
> parser error returns a 0, while success returns a 1.  You then need to
> call pyexpat.ErrorString( p.ErrorCode ) to find out what went wrong.
> 
> Pythonic principle #10 is "Errors should never pass silently"; should
> the module be changed to raise an exception on a parse error?  (Best
> to break compatibility now, while we still can...)
> 
> --
> A.M. Kuchling                   http://starship.python.net/crew/amk/
>     "That's kind of my uh sort of a joke."
>     "That's right, George. It differs from the usual kind of joke only in the
> vast gulf between it and any kind of a sense of humor."
>     -- George's face and Wanda, in SANDMAN #36: "Over the Sea to Sky"
> 
> _______________________________________________
> XML-SIG maillist  -  XML-SIG@python.org
> http://www.python.org/mailman/listinfo/xml-sig

-- 
 Paul Prescod  - ISOGEN Consulting Engineer speaking for himself
"I and my companions suffer from a disease of the heart that can only
be cured with gold", Hernan Cortes