EntityParser does not accept whitespace at end of file

Bug #131604 reported by Maarten ter Huurne
2
Affects Status Importance Assigned to Milestone
python-xml
Incomplete
Undecided
Unassigned
python-xml (Ubuntu)
Expired
Undecided
Unassigned

Bug Description

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.

Revision history for this message
Daniel T Chen (crimsun) wrote :

Is this symptom still reproducible in 8.10 beta or later?

Changed in python-xml:
status: New → Incomplete
Revision history for this message
Maarten ter Huurne (maarten-ter-huurne) wrote :

I don't have 0.8.10 beta or later installed and I don't really want to install from source and risk messing up my system. The bug report contains a test case that triggers the problem; if you have 0.8.10 beta or later installed please run the test program to see if the problem still occurs or not.

Revision history for this message
rusivi2 (rusivi2-deactivatedaccount) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. I noticed the version of Ubuntu your using is in End of Life status. More information may be found at: https://wiki.ubuntu.com/Releases As well, the package version your bugging is updated in Jaunty. Please update via http://releases.ubuntu.com/9.04/ repost a detailed error report, and update the bug status. Thanks!

Changed in python-xml:
status: New → Incomplete
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for python-xml (Ubuntu) because there has been no activity for 60 days.]

Changed in python-xml (Ubuntu):
status: Incomplete → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.