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 cito
Recipients cito
Date 2008-12-21.21:30:03
SpamBayes Score 1.4266366e-14
Marked as misclassified No
Message-id <1229895007.0.0.481278630748.issue4713@psf.upfronthosting.co.za>
In-reply-to
Content
If you install sgmlop (downloadable from
http://effbot.org/downloads/#sgmlop) under Python 2.x, then this can
break xmlrpclib.

You can reproduce this problem as follows (I have tested with Py 2.4,
2.5 and 2.6):

------------

data = """<?xml version="1.0" encoding="UTF-8"?>
<methodCall><methodName>f</methodName><params>
<param><value>k&#228;se</value></param>
</params></methodCall>"""

import xmlrpclib

assert xmlrpclib.FastParser is None
print xmlrpclib.SgmlopParser and 'with' or 'without', 'sgmlop'

assert xmlrpclib.loads(data) == ((u'k\xe4se',), 'f')

------------

If sgmlop is installed, this gives a UnicodeDecodeError, otherwise
everything works well.

This happens because xmlrpclib prefers using sgmlop over
lib.parsers.expat, but fails to handle numeric character entities
properly with this parser.

Find attached a patch that fixes this problem.

I also wonder whether lib.parsers.expat shouldn't be preferred over
sgmlop, since the latter is somewhat outdated, and installing external
libraries should not cause crashes or wrong behavior of standard lib
modules (see also Issue1772916 for a similar problem).
History
Date User Action Args
2008-12-21 21:30:07citosetrecipients: + cito
2008-12-21 21:30:07citosetmessageid: <1229895007.0.0.481278630748.issue4713@psf.upfronthosting.co.za>
2008-12-21 21:30:05citolinkissue4713 messages
2008-12-21 21:30:04citocreate