Comment #3 on issue 2121 by post-review doesn't handle bad passwords nicely

This is the hack I'm using for older python machines:

    diff --git a/rbtools/ b/rbtools/
    index df791aa..5323b9c 100755
    --- a/rbtools/
    +++ b/rbtools/
    @@ -12,6 +12,11 @@ from optparse import OptionParser
     import datetime

    +    from cStringIO import StringIO as FakeFile
    +except ImportError:
    +    from StringIO import StringIO as FakeFile
         # setuptools from
         from pkg_resources import parse_version
     except ImportError:
@@ -192,8 +197,19 @@ class ReviewBoardHTTPBasicAuthHandler(urllib2.HTTPBasicAuthHandler):
             if not self._retried:
                 self._retried = True
                 self.retried = 0
- response = urllib2.HTTPBasicAuthHandler.retry_http_basic_auth(
    -                self, *args, **kwargs)
    +            try:
+ response = urllib2.HTTPBasicAuthHandler.retry_http_basic_auth(
    +                    self, *args, **kwargs)
    +            except ValueError, e:
    +                # more than likely Python 2.4 client and
    +                # user used bad username/password
+ if e.args[0] == "AbstractDigestAuthHandler doesn't know about Basic" and sys.versio + # See
    +                    # Hack to log a slightly more useful error message
+ print 'ERROR: Suspect incorrect username and/or password'
    +                    fileptr = FakeFile('')
+ raise urllib2.HTTPError(None, 401, None, None, fileptr)
    +                raise

                 if response.code != 401:
                     self._retried = False

You received this message because this project is configured to send all issue notifications to this address.
You may adjust your notification preferences at:

You received this message because you are subscribed to the Google Groups 
"reviewboard-issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
To post to this group, send email to
Visit this group at
For more options, visit

Reply via email to