Commit 67e1478d authored by Victor Stinner's avatar Victor Stinner Committed by GitHub

bpo-30319: socket.close() now ignores ECONNRESET (#2565)

socket.close() was modified in Python 3.6 to raise OSError on
failure: see bpo-26685.
parent 378ebb65
......@@ -2696,7 +2696,9 @@ sock_close(PySocketSockObject *s)
Py_BEGIN_ALLOW_THREADS
res = SOCKETCLOSE(fd);
Py_END_ALLOW_THREADS
if (res < 0) {
/* bpo-30319: The peer can already have closed the connection.
Python ignores ECONNRESET on close(). */
if (res < 0 && errno != ECONNRESET) {
return s->errorhandler();
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment