Index: Lib/test/test_sax.py =================================================================== --- Lib/test/test_sax.py (revision 50855) +++ Lib/test/test_sax.py (working copy) @@ -8,6 +8,7 @@ except SAXReaderNotAvailable: # don't try to test this module if we cannot create a parser raise ImportError("no XML parsers available") + from xmlcore.sax.saxutils import XMLGenerator, escape, unescape, quoteattr, \ XMLFilterBase from xmlcore.sax.expatreader import create_parser @@ -670,7 +671,29 @@ attrs[(ns_uri, "attr")] == "val" and \ attrs.getQNameByName((ns_uri, "attr")) == "ns:attr" +import xml +if xml.__name__ == "xmlcore": + # + # Only the core implementation is available, and this may only + # apply in that case. Needs to be tested with Python 2.5 and + # PyXML still. + # + # This is specifically testing that the "xml" package is properly + # handled when the xmlcore package is used as the implementation. + def test_sf_1511497(): + # Bug report: http://www.python.org/sf/1511497 + sio = StringIO("invalid") + parser = make_parser() + from xml.sax import SAXParseException + try: + parser.parse(sio) + except SAXParseException: + return True + else: + return False + + # ===== Main program def make_test_output():