diff -r 5973743a52a1 Lib/urllib/request.py --- a/Lib/urllib/request.py Sun Mar 06 18:10:58 2011 -0600 +++ b/Lib/urllib/request.py Thu Apr 07 22:30:17 2011 +0300 @@ -819,6 +819,9 @@ if response and response.code != 401: self.retried = 0 return response + else: + raise HTTPError(req.full_url, 401, "unsupported auth '%s'" % authreq, + headers, None) def retry_http_basic_auth(self, host, req, realm): user, pw = self.passwd.find_user_password(realm, host)