This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author marienz
Recipients
Date 2006-06-27.21:06:49
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
There is something weird going on with xml.sax
exceptions, probably related to the xml/xmlcore shuffle:

from xml.sax import make_parser, SAXParseException
from StringIO import StringIO

parser = make_parser()

try:
    parser.parse(StringIO('invalid'))
except SAXParseException:
    print 'caught it!'

On python 2.4.3 this prints "caught it!". On python
2.5b1 the exception is not caught, because it is a
different  exception: an
xmlcore.sax._exceptions.SAXParseException. Printing the
SAXParseException imported from xml.sax gives "<class
'xml.sax._exceptions.SAXParseException'>".

Stumbled on this running the logilab-common (see
logilab.org) tests with python 2.5b1, but it seems
likely other code will be affected.
History
Date User Action Args
2007-08-23 14:40:52adminlinkissue1513611 messages
2007-08-23 14:40:52admincreate