Comment 5 for bug 1111553

Revision history for this message
Roland Hieber (rohieb) wrote :

Okay, this did not work every time. Apparently, python-keyring is buggy when it some to determining the default keyring (see https://bitbucket.org/kang/python-keyring-lib/issue/96/default-backend-sort-order-is-not), which resulted in Polly loading secrets sometimes from Gnome keyring, sometimes from the file backend... -.-

A a workaround, I created the file .local/share/python_keyring/keyringrc.cfg with this content:

[backend]
default-keyring = keyring.backend.Gnome.Keyring

I have patched /usr/bin/polly so that it prints the currently used keyring backend, and it really uses Gnome keyring now. However, Polly won't start anymore after this change, and dies with a backtrace:

current keyring is:
<keyring.backends.Gnome.Keyring object at 0x7fe9fdc9da10>
Traceback (most recent call last):
  File "/usr/bin/polly", line 330, in <module>
    account_manager = gui.twitter.account.Manager(NAME, config_path, config_path_lock, setting_factory, proxy_controller, font_scheme, identifier_factory, status_bar)
  File "/usr/lib/python2.7/dist-packages/polly/gui/twitter/account.py", line 489, in __init__
    subtoken_secret = keyring.get_password(self.name, subtoken)
  File "/usr/lib/python2.7/dist-packages/keyring/core.py", line 36, in get_password
    return _keyring_backend.get_password(service_name, username)
  File "/usr/lib/python2.7/dist-packages/keyring/backends/Gnome.py", line 53, in get_password
    items = self._find_passwords(service, username)
  File "/usr/lib/python2.7/dist-packages/keyring/backends/Gnome.py", line 30, in _find_passwords
    from gi.repository import GnomeKeyring
  File "/usr/lib/python2.7/dist-packages/gi/__init__.py", line 27, in <module>
    from ._gi import _API, Repository
ImportError: cannot import name _API

I guess this is related to the fact that Polly is not yet ported to GObject Introspection and uses modules that are incompatible with GI, but the underlying python-keyring implementation uses introspection. I currently cannot downgrade to a previous version of python-keyring (the only version in Debian testing is 1.6), so I guess, I have to find a different Twitter client :-(