diff --git a/keyring/backends/libsecret.py b/keyring/backends/libsecret.py index 9142fd3e..51d7f630 100644 --- a/keyring/backends/libsecret.py +++ b/keyring/backends/libsecret.py @@ -40,6 +40,7 @@ class Keyring(KeyringBackend): "username": Secret.SchemaAttributeType.STRING, }, ) + collection = Secret.COLLECTION_DEFAULT @properties.ClassProperty @classmethod @@ -77,7 +78,6 @@ def get_password(self, service, username): def set_password(self, service, username, password): """Set password for the username of the service""" - collection = Secret.COLLECTION_DEFAULT attributes = { "application": self.appid, "service": service, @@ -86,7 +86,7 @@ def set_password(self, service, username, password): label = "Password for '{}' on '{}'".format(username, service) try: stored = Secret.password_store_sync( - self.schema, attributes, collection, label, password, None + self.schema, attributes, self.collection, label, password, None ) except GLib.Error as error: quark = GLib.quark_try_string('secret-error') diff --git a/tests/backends/test_libsecret.py b/tests/backends/test_libsecret.py index 9b8a633a..50fc2b84 100644 --- a/tests/backends/test_libsecret.py +++ b/tests/backends/test_libsecret.py @@ -18,6 +18,7 @@ def init_keyring(self): "password prompts are for this keyring" ) keyring = libsecret.Keyring() + keyring.collection = 'session' return keyring