jaraco / keyring

MIT License
1.26k stars 159 forks source link

Crash with gi.repository.GLib.GError: g-dbus-error-quark: The name org.freedesktop.secrets was not provided by any .service files #600

Closed Diaoul closed 1 year ago

Diaoul commented 2 years ago

Describe the bug It crashes

To Reproduce Steps to reproduce the behavior:

  1. Run keyring set system test
  2. Observe the exception
    Password for 'test' in 'system': 
    Traceback (most recent call last):
    File "/usr/bin/keyring", line 8, in <module>
    sys.exit(main())
    File "/usr/lib/python3.10/site-packages/keyring/cli.py", line 132, in main
    return cli.run(argv)
    File "/usr/lib/python3.10/site-packages/keyring/cli.py", line 68, in run
    return method()
    File "/usr/lib/python3.10/site-packages/keyring/cli.py", line 85, in do_set
    set_password(self.service, self.username, password)
    File "/usr/lib/python3.10/site-packages/keyring/core.py", line 60, in set_password
    get_keyring().set_password(service_name, username, password)
    File "/usr/lib/python3.10/site-packages/keyring/backends/libsecret.py", line 85, in set_password
    stored = Secret.password_store_sync(
    gi.repository.GLib.GError: g-dbus-error-quark: The name org.freedesktop.secrets was not provided by any .service files (2)

Expected behavior Not an error

Environment

$ pip list | grep keyring
keyring              23.9.3

$ keyring --list-backends
keyring.backends.fail.Keyring (priority: 0)
keyring.backends.libsecret.Keyring (priority: 4.8)
keyring.backends.chainer.ChainerBackend (priority: -1)

Additional context At this is now a dependency of poetry, I cannot run poetry anymore. I can workaround this using:

export PYTHON_KEYRING_BACKEND=keyring.backends.null.Keyring
lazka commented 1 year ago

I've created #603 for this