Re: Question about using urllib2 to load a url

2007-04-04 Thread John J. Lee
"Kushal Kumaran" <[EMAIL PROTECTED]> writes: [...] > If, at any time, an error response fails to reach your machine, the > code will have to wait for a timeout. It should not have to wait > forever. [...] ...but it might have to wait a long time. Even if you use socket.setdefaulttimeout(), DNS l

Re: Question about using urllib2 to load a url

2007-04-01 Thread Kushal Kumaran
On Apr 2, 2:52 am, "ken" <[EMAIL PROTECTED]> wrote: > Hi, > > i have the following code to load a url. > My question is what if I try to load an invalide url > ("http://www.heise.de/";), will I get an IOException? or it will wait > forever? > Depends on why the URL is invalid. If the URL refers t

Question about using urllib2 to load a url

2007-04-01 Thread ken
Hi, i have the following code to load a url. My question is what if I try to load an invalide url ("http:// www.heise.de/"), will I get an IOException? or it will wait forever? Thanks for any help. opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj)) urllib2.install_opener(opener)