diff -r c177faafec51 -r c6a4d267fe88 Lib/urllib/request.py --- a/Lib/urllib/request.py Thu Mar 24 22:27:01 2011 +0800 +++ b/Lib/urllib/request.py Thu Mar 24 23:21:46 2011 +0800 @@ -543,8 +543,11 @@ else: return - # fix a possible malformed URL urlparts = urlparse(newurl) + + if not urlparts.scheme in ('http','https','ftp'): + return + if not urlparts.path: urlparts = list(urlparts) urlparts[2] = "/"