Skip to content

KeyringBackend set_password() keyword argument renamed by wrapper #717

@jdhalbert

Description

@jdhalbert

Describe the bug
Calling set_password() on a KeyringBackend with the keyword argument service results in a TypeError, but calling it with positional arguments works fine. service is (seemingly accidentally) renamed system here: https://github.com/jaraco/keyring/blame/24f94795c9e610d51d76caae5d139227e334a8cf/keyring/backend.py#L58

To Reproduce
Example in Windows 11:

k = keyring.get_keyring()
k.set_password(service='test_service', username='test_username', password='test_password')
# TypeError: WinVaultKeyring.set_password() missing 1 required positional argument: 'system'

k.set_password('test_service', 'test_username', 'test_password')
# OK

Expected behavior
set_password() should work with the keyword argument service instead of system.

Environment

  • OS:
    Tested with Windows but probably affects all plaforms.
$ pip list | grep keyring
keyring                 25.6.0
$ keyring --list-backends
keyring.backends.fail.Keyring (priority: 0)
keyring.backends.chainer.ChainerBackend (priority: -1)
keyring.backends.Windows.WinVaultKeyring (priority: 5)

Additional context
When using the KeyringBackend, the keyword is service but when using keyring the keyword is service_name. It may be more intuitive to have consistency here as well, but that is beside the point of this issue that the keyword system not used anywhere else.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions