Public bug reported: The xml.parsers.xmlproc.xmlutils.EntityParser class has a method "skip_ws" which skips whitespace. However, if it encounters end-of-file, it will raise "OutOfDataException" instead of returning normally at the end of the file. As a result, the catalog files from the "w3c-dtd-xhtml" package, some of which have whitespace at the end, are not parseable.
Example program: from xml.parsers.xmlproc import catalog xhtmlCatalog = catalog.SAX_catalog( '/usr/share/xml/xhtml/schema/dtd/1.0/catalog', catalog.CatParserFactory() ) Output: $ python readcatalog.py ERROR: Construct started, but never completed at /usr/share/xml/xhtml/schema/dtd/1.0/catalog:19:28 TEXT: ' ' Note that you will only get this output after patching bug 131595, otherwise the parsing will abort before the end of the file. Suggested solution: Disable the following lines in the "skip_ws" method: if match.end() == self.datasize: raise OutOfDataException() See "_xmlplus/parsers/xmlproc/xmlutils.py", line 451. Version info: python-xml 0.8.4-6ubuntu4 on feisty. ** Affects: python-xml (upstream) Importance: Undecided Status: New ** Affects: python-xml (Ubuntu) Importance: Undecided Status: New ** Also affects: python-xml (upstream) Importance: Undecided Status: New -- EntityParser does not accept whitespace at end of file https://bugs.launchpad.net/bugs/131604 You received this bug notification because you are a member of Ubuntu Bugs, which is the bug contact for Ubuntu. -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs