[issue26402] Regression in Python 3.5 http.client, raises RemoteDisconnected seemingly randomly.
Jelte Fennema
report at bugs.python.org
Sun Feb 21 11:19:13 EST 2016
Jelte Fennema added the comment:
A short look through the stacktrace actually seemed to have gotten me to the issue. It is in the xmlrpc.client library in this piece of code:
for i in (0, 1):
try:
return self.single_request(host, handler, request_body, verbose)
except OSError as e:
if i or e.errno not in (errno.ECONNRESET, errno.ECONNABORTED,
errno.EPIPE):
raise
except http.client.RemoteDisconnected:
if i:
raise
As can be seen http.client.RemoteDisconnected error is caught after the OSError one. However http.client.RemoteDisconnected is a subclass of OSError since it's a subclass of ConnectionResetError: https://docs.python.org/3/library/http.client.html#http.client.RemoteDisconnected
A simple fix which seems to work for me is switching the two except branches as I did in the attached patch.
----------
keywords: +patch
Added file: http://bugs.python.org/file41987/xmlrpc-remote-disconnected.patch
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue26402>
_______________________________________
More information about the Python-bugs-list
mailing list