Martin Panter added the comment:
I think fixing all affected calls to socket.close in the world (option 3) would
be too much. I just added two new reports (Issue 30652 and Issue 30391) as
dependencies. These are about testing socketserver.TCPServer. As an example, to
fix the socket.close call there, I think the change would look like
class TCPServer:
def close_request(self, request):
try:
request.close()
except ConnectionError:
# Suppress asynchronous errors such as ECONNRESET on Free BSD
pass
Instead of that change all over the place, I am thinking option 2 would be
safest. In Modules/socketmodule.c, something like
sock_close(PySocketSockObject *s)
{
Py_BEGIN_ALLOW_THREADS
res = SOCKETCLOSE(fd);
Py_END_ALLOW_THREADS
/* ECONNRESET can occur on Free BSD */
if (res < 0 && errno != ECONNRESET) {
return s->errorhandler();
}
}
----------
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue30319>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com