Handling urllib2's timeout? - Python

Posted by RadiantHex on Stack Overflow See other posts from Stack Overflow or by RadiantHex
Published on 2010-04-26T10:03:37Z Indexed on 2010/04/26 10:13 UTC
Read the original article Hit count: 298

Filed under:
|
|
|

Hi folks,

I'm using the timeout parameter within the urllib2's urlopen.

urllib2.urlopen('http://www.example.org', timeout=1)

How do I tell Python that if the timeout expires a custom error should be raised?


Any ideas?

© Stack Overflow or respective owner

Related posts about python

Related posts about urllib2