[New-bugs-announce] [issue10860] urllib2 crashes on valid URL

Senthil Kumaran orsenthil at gmail.com
Sat Jan 8 09:11:23 CET 2011


On Fri, Jan 07, 2011 at 07:14:30PM +0000, Shawn Ligocki wrote:
> 
> I think the problem is that "http://118114.cn" says it redirects to
> "http://www.118114.cn:", but it seems like urllib2 should be able to
> deal with that or at least report back a more useful error message.

I think, this is improper at the Server End to redirect it to URL
where ':' is provided and Port is missing.

Any client, which does a transparent redirection, can be expected to fail.

senthil at rubuntu:~$ curl -L http://118114.cn
curl: (6) Couldn't resolve host 'www.118114.cn:'

The Redirected URL is an Invalid Syntax and I don't think we should
fix by providing a default port at urllib2 end. What can be done is
fail with timeout or raise an Exception for an Invalid URL.


More information about the New-bugs-announce mailing list