[XML-SIG] Another SAX Suggestion

Walter Underwood wunder@infoseek.com
Fri, 30 Apr 1999 08:51:19 -0700


At 11:19 AM 4/28/99 -0500, Paul Prescod wrote:
>I would like to suggest the default error handlers do something useful:
>
>    def error(self, exception):
>        "Handle a recoverable error."
>        sys.stderr.write( "Error: "+ exception )

Since we write servers, we consider output to stderr from a library
to be a defect. Anybody else remember "RANGE ERROR" from the
C math library?

I had to rip out some stderr writes from pyexpat, too.

I wouldn't mind having a stderr error handler provided as part 
of the module, with sample code that uses that error handler.

Also along this line, does the SAX adaptor for expat catch all
exceptions raised in a handler? The Expat core doesn't know how
to propagate exceptions, so they need to be caught and reported 
locally. This is an interesting behavior difference between SAX
over different parser implementations (a pure-Python parser would
propagate the exceptions).

Sorry for the ignorance of SAX details -- our XML support shipped 
last September and I haven't gone back and re-coded to the portable 
interface.

wunder



--
Walter R. Underwood
wunder@infoseek.com
wunder@best.com (home)
http://software.infoseek.com/cce/ (my product)
http://www.best.com/~wunder/
1-408-543-6946