Undocumented Python. Sockets. TimeoutError

Both connect() and recv() related calls can raise TimeoutError exception as result of the network cable unplugg on a client side.

TimeoutError exception is raised as result of receving 'ETIMEDOUT' socket error which can be generated by connect() and recv() calls.

It can be raised on a connected socket only (TCP connection for example)

This exception can be raised as result of:
1. network cable unplugged (on a client or/and on a server side)
1. client device power off
1. router power off
1. client application crash or kill
1. etc.

This exception will be raised after a while of the actual cause. Usually after a 10 minutes after the actual client disconnection. Actual timeout is OS dependent.

Incomplete list of Python functions that can raise TimeoutError:
socket.connect, socket.recv, socket.recv_into

Also, I believe, asyncio corresponding functions are inherit the same behavior.

I've encountered this exception in my ASockIOCore during the testing phase: as result of the network cable unplugging on a client side.

Conclusion:

During the development I've not realized that Python documentation can lack a such kind of crucial information. It would be nice to add to the description of each function, a complete list of exceptions that can be raised by this function.