Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to set keyring to OS_X.Keyring #504

Closed
felixgao opened this issue Mar 17, 2021 · 2 comments
Closed

Unable to set keyring to OS_X.Keyring #504

felixgao opened this issue Mar 17, 2021 · 2 comments
Labels

Comments

@felixgao
Copy link

Describe the bug
The keyring must be a subclass of KeyringBackend

To Reproduce
Steps to reproduce the behavior:

  1. poetry install keyring
  2. add the following code
import keyring
from keyring.backends import OS_X
keyring.set_keyring(OS_X.Keyring)
  1. run the script

Expected behavior
the keyring is set to OSX's keyring

Environment

  • OS: OS X 10.15.7
$ pip list | grep keyring
keyring                   23.0.0
...
$ keyring --list-backends
keyring.backends.macOS.Keyring (priority: 5)
keyring.backends.fail.Keyring (priority: 0)
keyring.backends.chainer.ChainerBackend (priority: -1)
...

Additional context
installed using poetry with .venv created via pyenvs
python version is 3.6.12

@jaraco
Copy link
Owner

jaraco commented Mar 25, 2021

The error message is incorrect. It should say "The keyring must be an instance of KeyringBackend". You need to pass an instance of the backend, i.e. keyring.set_keyring(OS_X.Keyring()). Also, be aware that since keyring 22 and later, you should prefer keyring.backends.macOS to keyring.backends.OS_X.

@jaraco
Copy link
Owner

jaraco commented Mar 25, 2021

By the way, if you're on macOS, you don't need to set the keyring. It will be discovered automatically (based on the priorities).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants