We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 378ebb6 commit 67e1478Copy full SHA for 67e1478
2 files changed
Misc/NEWS.d/next/Library/2017-07-04-13-48-21.bpo-30319.hg_3TX.rst
@@ -0,0 +1 @@
1
+socket.close() now ignores ECONNRESET error.
Modules/socketmodule.c
@@ -2696,7 +2696,9 @@ sock_close(PySocketSockObject *s)
2696
Py_BEGIN_ALLOW_THREADS
2697
res = SOCKETCLOSE(fd);
2698
Py_END_ALLOW_THREADS
2699
- if (res < 0) {
+ /* bpo-30319: The peer can already have closed the connection.
2700
+ Python ignores ECONNRESET on close(). */
2701
+ if (res < 0 && errno != ECONNRESET) {
2702
return s->errorhandler();
2703
}
2704
0 commit comments