[Tutor] urllib2.urlopen(....., timeout=)

Steven D'Aprano steve at pearwood.info
Fri Sep 7 17:33:58 CEST 2012


On 08/09/12 01:16, Ray Jones wrote:
> 2.7.3
> According to the docs, urlopen has a timeout capability. But it says
> that the timeout = '<object object>'

Which docs are those? According to these docs:

http://docs.python.org/library/urllib2.html

"The optional timeout parameter specifies a timeout in seconds for
blocking operations like the connection attempt (if not specified,
the global default timeout setting will be used). This actually
only works for HTTP, HTTPS and FTP connections."


> I've tried integers as the timeout value, I've tried floats....it
> doesn't complain about my values, but neither does it timeout.

Can you give an actual working example of what you have tried, what
you expect to happen, and what actually happens?


-- 
Steven


More information about the Tutor mailing list