[New-bugs-announce] [issue10108] ExpatError not property wrapped

Leo Shklovskii report at bugs.python.org
Thu Oct 14 23:54:30 CEST 2010

New submission from Leo Shklovskii <leos at thermopylae.net>:

>From my understanding of the documentation, the expected behavior is for xmlrpclib to raise an xmlrpclib.Fault wrapping the original error from whatever parser it chose to use if there's an error in parsing the response.

If, however, its using Expat under the hood and the response is completely blank, the ExpatError percolates up to the calling code unwrapped.

The following stack trace
/usr/lib/python2.6/xmlrpclib.pyc in __call__(self, *args)
   1197         return _Method(self.__send, "%s.%s" % (self.__name, name))
   1198     def __call__(self, *args):
-> 1199         return self.__send(self.__name, args)
   1201 ##

/usr/lib/python2.6/xmlrpclib.pyc in __request(self, methodname, params)
   1487             self.__handler,
   1488             request,
-> 1489             verbose=self.__verbose
   1490             )

/usr/lib/python2.6/xmlrpclib.pyc in request(self, host, handler, request_body, verbose)
   1251             sock = None
-> 1253         return self._parse_response(h.getfile(), sock)
   1255     ##

/usr/lib/python2.6/xmlrpclib.pyc in _parse_response(self, file, sock)
   1389         file.close()
-> 1390         p.close()
   1392         return u.close()

/usr/lib/python2.6/xmlrpclib.pyc in close(self)
    603         def close(self):
--> 604             self._parser.Parse("", 1) # end of data
    605             del self._target, self._parser # get rid of circular references

ExpatError: no element found: line 1, column 0

Please let me know if I'm misinterpreting the docs or if you need any other information to repro this bug.

components: XML
messages: 118721
nosy: leos
priority: normal
severity: normal
status: open
title: ExpatError not property wrapped
type: behavior
versions: Python 2.6

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list