[issue5293] socket timeouts even in blocking mode
report at bugs.python.org
Wed Feb 18 00:07:29 CET 2009
anatoly techtonik <techtonik at gmail.com> added the comment:
Isn't it a job of crossplatform programming language to abstract from
low-level platform details?
The scope of this bug is not about handling all possible Winsock errors.
It is about proper handling the sole timeout error from the list
http://www.winsock-error.com/ to make socket.connect() interface
consistent for both windows and linux.
In addition I believe that new socket.create_connection() function is
vulnerable to the same issue and its only a matter of time when somebody
reports that its additional "timeout" argument should be less than
mystic system network timeout value. That's why some sort of generalized
socket.connection_timeout exception is still needed.
BTW, I have tested the behaviour on linux - the system timeout on socket
does occur, but with different error code.
socket.error: (110, 'Connection timed out')
Note that the error message is different too. That means that to
properly wait for service to appear (or retry to reconnect later if
server is not available) you need to handle three error cases.
Python tracker <report at bugs.python.org>
More information about the Python-bugs-list