Senthil Kumaran <orsent...@gmail.com> added the comment: 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. sent...@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. ---------- title: Handle empty port after port delimiter in httplib -> urllib2 crashes on valid URL _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue10860> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com