Comment 19 for bug 1154870

Revision history for this message
Tony Garnock-Jones (tonyg) wrote :

At least one of the calls to keyring.set_password is encoding self.name, but the call to keyring.get_password is not. I was suffering from the problem described in this bug report, with symptoms as follows:

1. start polly with no configuration (i.e. after deleting .config/polly)
2. register account with twitter successfully
3. presented with twitter timeline, all seems well
4. quit polly
5. read .config/polly/accounts -- it has a nonempty JSON array in it
6. start polly
7. oh dear! prompted to register with twitter again
8. without closing polly or taking any further gui action, read .config/polly/accounts -- it now has an empty JSON array in it, that is, the registration has already been overwritten

I may have fixed the issue by applying the following patch. Unfortunately, I can no longer reproduce the issue, even with the unmodified version of the code! So I can't quite confirm the fix. I can say, however, that before the patch it failed repeatedly, and on the first run after applying the patch, it successfully stored and retained the information needed for logging in to my twitter account. It's been fine since.

Polly 0.93.11 (pre-alpha 3.11)
from 0.93.11-0~427~ubuntu13.10.1
on Debian jessie

--- /usr/share/pyshared/polly/gui/twitter/account.py 2013-11-20 05:22:33.000000000 -0500
+++ account-tonyg-edits.py 2013-12-14 12:26:32.000000000 -0500
@@ -483,7 +483,7 @@
                     if id < 0:
                         raise ValueError

- subtoken_secret = keyring.get_password(self.name, subtoken)
+ subtoken_secret = keyring.get_password(self.name.encode(ENCODING), subtoken)

                     if subtoken_secret is None:
                         raise ValueError