Index: Lib/urllib2.py =================================================================== --- Lib/urllib2.py (revisiĆ³n: 65710) +++ Lib/urllib2.py (copia de trabajo) @@ -560,6 +560,14 @@ newurl = headers.getheaders('uri')[0] else: return + + # fix a possible malformed URL + urlparts = urlparse.urlparse(newurl) + if not urlparts.path: + urlparts = list(urlparts) + urlparts[2] = "/" + newurl = urlparse.urlunparse(urlparts) + newurl = urlparse.urljoin(req.get_full_url(), newurl) # XXX Probably want to forget about the state of the current