--- /usr/lib/python2.6/urllib2.py.orig 2009-09-12 00:14:26.000000000 +0200 +++ /usr/lib/python2.6/urllib2.py 2009-09-12 01:22:49.000000000 +0200 @@ -111,7 +111,7 @@ splitattr, ftpwrapper, splituser, splitpasswd, splitvalue) # support for FileHandler, proxies via environment variables -from urllib import localhost, url2pathname, getproxies +from urllib import localhost, url2pathname, getproxies, proxy_bypass # used in User-Agent header sent __version__ = sys.version[:3] @@ -694,6 +694,9 @@ proxy_type, user, password, hostport = _parse_proxy(proxy) if proxy_type is None: proxy_type = orig_type + if proxy_bypass(req.host): + # Let other handlers take care of it + return None if user and password: user_pass = '%s:%s' % (unquote(user), unquote(password)) creds = base64.b64encode(user_pass).strip()