[lxml-dev] PATCH: XMLSyntaxError

Stefan Behnel behnel_ml at gkec.informatik.tu-darmstadt.de
Mon Nov 7 03:23:55 CST 2005

Andrey Tatarinov wrote:
> I apologize for a little aggressiveness of my previous letter, that was
> a hard day.

Actually, it was the last two e-mails. Anyway, appology accepted.

> but nevertheless plot is the same: we have a lot more "common words" in
> lxml.etree other than "Error", and I think we should treat them all the
> same way. i.e. when we rename Error to LxmlError we should do the same
> with parse, dump, etc.

Ok, I see your point. And all of these are there for compatibility with
ElementTree. So you'd need to do a lot of explaining to rename them all. I
don't think that's worth it. So I'll revert the last revision of my branch.
Any more comments on this patch then?

Index: src/lxml/etree.pyx
--- src/lxml/etree.pyx  (Revision 19584)
+++ src/lxml/etree.pyx  (Revision 19585)
@@ -41,7 +41,7 @@
 class Error(Exception):

-class XMLSyntaxError(SyntaxError):
+class XMLSyntaxError(Error, SyntaxError):

 class XPathError(Error):
@@ -56,7 +56,7 @@
 class XPathResultError(XPathError):

-class XPathSyntaxError(SyntaxError):
+class XPathSyntaxError(Error, SyntaxError):

 class XSLTError(Error):

More information about the lxml mailing list