[Python-Dev] Timeout in urllib2.urlopen

Facundo Batista facundo at taniquetil.com.ar
Wed Jun 6 21:19:36 CEST 2007


facundo at expiron:~/devel/reps/python/trunk$ ./python 
Python 2.6a0 (trunk, Jun  6 2007, 12:32:23) 
[GCC 4.1.2 (Ubuntu 4.1.2-0ubuntu4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import urllib2
>>> u = urllib2.urlopen("http://www.taniquetil.com.ar/plog")
>>> u.headers.items()
[..., ('content-type', 'text/html;charset=iso-8859-1'), ...]
>>> 
>>> u = urllib2.urlopen("http://www.taniquetil.com.ar/plog", timeout=3)
Traceback (most recent call last):
  ...
urllib2.URLError: <urlopen error timed out>
>>> 

Ok, my blog is a bit slow, but the timeout is working ok, :D

Regards,

-- 
.   Facundo
.
Blog: http://www.taniquetil.com.ar/plog/
PyAr: http://www.python.org/ar/




More information about the Python-Dev mailing list