Hi Jakub, you're correct in that configuring the socket to use blocking mode will prevent this error. However I suspect that it could cause problems if a timeout is passed to the send() call. I think that using blocking could end up having send() block and not return within the requested timeout.
Although the non-SSL socket blocks, the python client uses select() in order to avoid making blocking calls to the socket. So even though the socket is blocking, the code won't make a call to the socket unless it knows it will not block.
This won't work for SSL sockets. This is because our application cannot control when the SSL library writes or reads from the socket. Specifically, if a read() (or write()) is done on a blocking SSL socket, the underlying SSL library may in turn call write() (or read()) as needed in order to perform an SSL handshake. For example, if the python client's select() indicates that the socket is writable (but not readable), and we call write() on the SSL socket, the SSL library may then need to perform a read(), which could block indefinitely. Depending on how long SSL blocks, there's no guarantee that it will return in enough time to handle the timeout properly.