From the urllib2documentation ...
An additional timeout parameter defines the timeout in seconds for blocking operations, such as a connection attempt (if not specified, the global default timeout setting will be used). This actually works for HTTP, HTTPS and FTP connections.
source
share