Message14007
I've recently noticed AssertionErrors being raised by
httplib.LineAndFileWrapper.read(). It happens reliably when the server
exits unexpectedly. Here's an example of an AssertionError in an
xmlrpclib client when I kill the server it's talking to:
Traceback (most recent call last):
File "qa.py", line 22, in ?
x = s.query(tmpl, st, en, radius, age)
File "/Users/skip/local/lib/python2.3/xmlrpclib.py", line 985, in __call__
return self.__send(self.__name, args)
File "/Users/skip/local/lib/python2.3/xmlrpclib.py", line 1269, in __request
verbose=self.__verbose
File "/Users/skip/local/lib/python2.3/xmlrpclib.py", line 1036, in request
return self._parse_response(h.getfile(), sock)
File "/Users/skip/local/lib/python2.3/xmlrpclib.py", line 1165, in _parse_response
response = file.read(1024)
File "/Users/skip/local/lib/python2.3/httplib.py", line 1150, in read
assert not self._line_consumed and self._line_left
AssertionError
I don't see a problem with raising an exception in this situation. I just
wonder if AssertionError is the best exception to raise (unless of course, the cause is a logic error in the httplib code). If an exception
is being raised because the server went away, I think it would be
better to raise IncompleteRead. |
|
Date |
User |
Action |
Args |
2007-08-23 14:09:58 | admin | link | issue666219 messages |
2007-08-23 14:09:58 | admin | create | |
|