zdenekmaxa at yahoo.co.uk
Mon Aug 3 11:19:11 CEST 2009
I would like to ask how I should set timeout for a call:
f = urllib2.urlopen(url)
I am using Python 2.5. I have already tried
socket.setdefaulttimeout(3). However, this adversely affects other
connections the application makes, since it seems to affect all socket
I know that Python 2.6 offers
urllib2.urlopen(url[, data][, timeout])
which would elegantly solved my problem, but I have to stick to Python 2.5.
I am doing urlopen in a thread so I want to avoid really long hanging on
this call, which happens at times, until some default timeout ticks out.
All hints appreciated.
More information about the Python-list