Message 237616 - Python tracker (original) (raw)

If EINTR is received during connect, the socket is unusable, that's why i didn't implement it.

Can you elaborate?

socket.connect() should be modified according to the PEP 475: https://www.python.org/dev/peps/pep-0475/#modified-functions

What do you mean by "unusable"? Is it possible to retry connect()? Is it safe to call getsockopt(fd, SOL_SOCKET, SO_ERROR) until it returns EISCONN?

For high-level functions for socket.create_connection(), how should we handle InterruptedError?

See also this change in asyncio to handle InterruptedError in asyncio: https://hg.python.org/cpython/rev/ad67f66a5f3c (I wrote it and I didn't test my change, I didn't know how to test it.) Tulip issue: https://code.google.com/p/tulip/issues/detail?id=205