question about lp access to bzr+ssh and empty/wrong password

John Arbash Meinel john at arbash-meinel.com
Thu Feb 5 20:11:40 GMT 2009


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


...
> Well, I see this in qbzr's lib/uifactory.py:
> 
> def get_password(self, prompt='', **kwargs):
>     password, ok = QtGui.QInputDialog.getText(self.current_widget(),
>                                               gettext("Enter Password"),
>                                               (prompt % kwargs),
>                                               QtGui.QLineEdit.Password)
> 
>     if ok:
>         return str(password)
>     else:
>         raise KeyboardInterrupt()
> 
> I don't think things would be trapping the KeyboardInterrupt, which
> means that you are again raising an exception, which has to propagate up
> the stack, which ends up triggering a "try/finally:unlock()" code path,
> which is then aborting because the connection is already closed, so we
> aren't actually able to send the unlock() request.
> 
> Then again, we shouldn't be trying to send anything to the request,
> since we haven't actually connected yet. Regardless, I think there is
> some cleanup step that thinks it has finished connecting, and is trying
> to 'close()' in a rational manner, which then is triggering the "you
> can't send any more messages because there is no channel to write to"
> (in this case, because there never *was* a channel).
> 
> John
> =:->

Again looking closer, I missed the fact that you are using the
SubprocessUIFactory, which has a different implementation:

def get_password(self, prompt='', **kwargs):
    from bzrlib.util import bencode
    prompt = prompt % kwargs
    self.stdout.write('qbzr:GETPASS:' +
bencode.bencode(prompt.encode('utf-8')) + '\n')
    self.stdout.flush()
    line = self.stdin.readline()
    if line.startswith('qbzr:GETPASS:'):
        passwd, accepted = bencode.bdecode(line[13:].rstrip('\r\n'))
        if accepted:
            return passwd
    return ''

Which is "send a request to the master process, use bencode to
encode/decode the result, and return either the password or '' if not
accepted".

I still get the feeling that you are getting a double-exception problem.
Something is going on which is triggering a genuine exception, which is
then getting masked by a cleanup function which is triggering the
TooManyConcurrentRequests exception.

John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkmLR/wACgkQJdeBCYSNAAOo/QCeM1fFmvR5ah7ybAvXL1V5DaU9
VuIAn1zxcbh+jYL/tj+HoI+OyYyDP9rH
=As/h
-----END PGP SIGNATURE-----



More information about the bazaar mailing list