0

I'm trying to use keyring python module on Mac.

keyring.get_password

returns None, although I am pretty sure that the keyring and the username in it both exist. Any idea what could be the problem?

To give a more concrete example, this piece of code:

print "'{}' '{}' [{}]".format(KEYRING, username, keyring.get_keyring())
return keyring.get_password(KEYRING, username)

prints this when I invoke it with concrete arguments:

'login' 'skype' [<keyring.backends.OS_X.Keyring object at 0x10c85b450>]
Stevoisiak
  • 23,794
  • 27
  • 122
  • 225
Andre
  • 637
  • 6
  • 16
  • Can you show us exactly what arguments you’re supplying to `get_password`? You can change the username, but it might be helpful. – alexwlchan Apr 10 '15 at 05:58
  • I have updated the original question with an example – Andre Apr 10 '15 at 11:31
  • Try storing a password first with `keyring.set_password("myapp", "username", "password")`, then retrieving it with `keyring.get_password("myapp", "username")` – Stevoisiak Feb 16 '18 at 15:10

0 Answers0