diff --git a/Lib/http/client.py b/Lib/http/client.py index c83c53b60b0..e4a9c079d93 100644 --- a/Lib/http/client.py +++ b/Lib/http/client.py @@ -734,11 +734,6 @@ def send(self, str): else: raise NotConnected() - # send the data to the server. if we get a broken pipe, then close - # the socket. we want to reconnect when somebody tries to send again. - # - # NOTE: we DO propagate the error, though, because we cannot simply - # ignore the error... the caller will know if they can retry. if self.debuglevel > 0: print("send:", repr(str)) blocksize = 8192 diff --git a/Lib/xmlrpc/client.py b/Lib/xmlrpc/client.py index a72908cb978..d9c43c24b41 100644 --- a/Lib/xmlrpc/client.py +++ b/Lib/xmlrpc/client.py @@ -1135,7 +1135,7 @@ def request(self, host, handler, request_body, verbose=False): try: return self.single_request(host, handler, request_body, verbose) except socket.error as e: - if i or e.errno not in (errno.ECONNRESET, errno.ECONNABORTED): + if i or e.errno not in (errno.ECONNRESET, errno.ECONNABORTED, errno.EPIPE): raise except http.client.BadStatusLine: #close after we sent request if i: diff --git a/Misc/NEWS b/Misc/NEWS index 295a9a7e732..ee46e94d7a9 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -473,6 +473,10 @@ C-API Library ------- +- Issue #9032: XML-RPC client retries the request on EPIPE error. The EPIPE + error occurs when the server closes the socket and the client sends a big + XML-RPC request. + - Issue #4629: getopt raises an error if an argument ends with = whereas getopt doesn't except a value (eg. --help= is rejected if getopt uses ['help='] long options).