[XML-SIG] Error in pyexpat docs

Martin v. Loewis martin@loewis.home.cs.tu-berlin.de
Thu, 2 Nov 2000 06:04:22 +0100

> The wrong, "xml.parsers.expat" is the first indicator that there might be a 
> problem, yet I took the docs at their word and wrapped the call to ParseFile 
> in a blanket try/except, only to find that no exception of any sort is ever 
> raised by ParseFile.

> It turns out that ParseFile actually returns 0 on error, returning 1
> otherwise.

> The first matter is that the code and the docs need to be reconciled.  
> However, I would _much_ rather prefer that things were as in the docs.

Thanks for the report. What do you mean with 'the wrong,
"xml.parsers.expat"'? There really is an exception
xml.parsers.expat.error, and it really is raised from
xml.parsers.expat (aka pyexpat).

It turns out that it is only raised for Parse, not for ParseFile,
which is a bug introduced when the return value of these functions was
changed from a number to an exception. In the PyXML CVS, I have
corrected that error. As a result, PyXML 0.6.2 will build its own
pyexpat.c even for Python 2.0, which will implement the documentation.