Comment 33 for bug 686690

Revision history for this message
Martin Pool (mbp) wrote : Re: [Bug 686690] Re: 1.8.0 breaks login_with() API compat with existing credentials files, and forces keyrings

On 7 January 2011 10:25, Leonard Richardson
<email address hidden> wrote:
> Great, the one LOC we still can't regression-test has a bug. Fortunately
> it's just a missing import.
>
> This is easy to fix, but there's another problem. I don't think it's bad
> enough to scratch the whole project, and it might be considered a
> relatively minor bug in keyring. Let's talk it out.
>
> Right now I can't run a launchpadlib script over an SSH session. I get
> this error when keyring tries to access the GNOME keyring on the foreign
> computer:
>
>  File "/home/leonardr/canonical/lp-sourcedeps/eggs/keyring-0.5-py2.6.egg/keyring/backend.py", line 139, in get_password
>    items = gnomekeyring.find_network_password_sync(username, service)
> gnomekeyring.IOError
>
> That makes sense--no reason why I should be able to SSH into another
> machine and dump the keyring--but it prevents Launchpad.login_with()
> from working at all.
>
> I would like to be able to tell keyring to fall back to an encrypted
> file instead of crashing in this situation. But I don't know if this is
> the right thing to do in general.

Just catch the gnomekeyring.IOError and assume it means there is no keyring