how to deal with socket.error: (10060, 'Operation timed out')

2006-03-18 Thread JuHui
I wrote a script to get 100 pages from a server. like below: 1:import httplib 2:conns = httplib.HTTPConnection(www.mytest.com) 3:conn.request(GET, /) sometimes a socket error was raised. File D:\usr\bin\lib\httplib.py, line 627, in connect raise socket.error, msg socket.error: (10060,

Re: how to deal with socket.error: (10060, 'Operation timed out')

2006-03-18 Thread Fredrik Lundh
JuHui wrote: I wrote a script to get 100 pages from a server. like below: 1:import httplib 2:conns = httplib.HTTPConnection(www.mytest.com) 3:conn.request(GET, /) sometimes a socket error was raised. File D:\usr\bin\lib\httplib.py, line 627, in connect raise socket.error, msg

Re: how to deal with socket.error: (10060, 'Operation timed out')

2006-03-18 Thread gregarican
JuHui wrote: I wrote a script to get 100 pages from a server. like below: 1:import httplib 2:conns = httplib.HTTPConnection(www.mytest.com) 3:conn.request(GET, /) sometimes a socket error was raised. File D:\usr\bin\lib\httplib.py, line 627, in connect raise socket.error, msg

Re: how to deal with socket.error: (10060, 'Operation timed out')

2006-03-18 Thread JuHui
thanks! I try the try before, but can't catch the socket error. so strange, maybe my code was error. I wrote a retry code block as below. import httplib,time while 1: try: conn = httplib.HTTPConnection(www.test.com) conn.request(GET, /) print success break