[issue5293] socket timeouts even in blocking mode

2009-02-20 Thread anatoly techtonik
anatoly techtonik added the comment: Thanks for pointing me to the list of possible network errors. This information is invaluable. Too bad it is easily lost among other details. I've seen similar errors in other modules that use socket module and it's no wonder now why people can't handle them

[issue5293] socket timeouts even in blocking mode

2009-02-17 Thread Gregory P. Smith
Gregory P. Smith added the comment: Yes it is annoying to have to deal with the different OS specific error numbers when handling socket.error, OSError, IOError or EnvironmentError subclasses in general but that is life. Python does not attempt to figure out what all possible behaviors and erro

[issue5293] socket timeouts even in blocking mode

2009-02-17 Thread Martin v. Löwis
Martin v. Löwis added the comment: > Isn't it a job of crossplatform programming language to abstract from > low-level platform details? It's certainly not Python's job. It's an explicit design goal, and a long tradition, to expose system interfaces *as is*, with the very same parameters, and t

[issue5293] socket timeouts even in blocking mode

2009-02-17 Thread anatoly techtonik
anatoly techtonik 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-err

[issue5293] socket timeouts even in blocking mode

2009-02-17 Thread Martin v. Löwis
Martin v. Löwis added the comment: 10060 is a winsock error, and there are many, MANY more of them. Read the winsock documentation for details. It's both impossible and pointless to document them, since some never occur, others aren't documented by Microsoft well enough in the first place. Many

[issue5293] socket timeouts even in blocking mode

2009-02-17 Thread anatoly techtonik
anatoly techtonik added the comment: After rewriting my reply several times I've noticed my mistake, but it took more time to understand the problem than could be expected for a language that we all would like to see as easy and intuitive as possible. That why I still would like to see this bugr

[issue5293] socket timeouts even in blocking mode

2009-02-17 Thread Martin v. Löwis
Martin v. Löwis added the comment: > Because documentation doesn't say that Python should timeout after 20 > seconds after entering blocking mode if socket to remote host can not be > opened. That's not true: The documentation says "In blocking mode, operations block until complete." It takes 2

[issue5293] socket timeouts even in blocking mode

2009-02-17 Thread Gregory P. Smith
Gregory P. Smith added the comment: You can't use a connect() call for the purpose of waiting for your network to be up. This has nothing to do with Python. This is how all network APIs work regardless of OS and language. The "timeout" is due to the network stack being unable to find the r

[issue5293] socket timeouts even in blocking mode

2009-02-17 Thread anatoly techtonik
anatoly techtonik added the comment: Because documentation doesn't say that Python should timeout after 20 seconds after entering blocking mode if socket to remote host can not be opened. ___ Python tracker

[issue5293] socket timeouts even in blocking mode

2009-02-17 Thread Martin v. Löwis
Martin v. Löwis added the comment: Why do you think this is a bug in Python? -- nosy: +loewis ___ Python tracker ___ ___ Python-bugs-l

[issue5293] socket timeouts even in blocking mode

2009-02-17 Thread anatoly techtonik
New submission from anatoly techtonik : The code below exits with timeout after about 20 secs on Windows + Python 2.5.4 import socket # address of server routable, but offline server = "192.168.1.2" s = socket.socket() s.setblocking(1) s.connect((server, 139)) s.close() The output is: Tracebac