jaraco / jaraco/keyring

KeyringBackend set_password() keyword argument renamed by wrapper

Open
#717 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
1.5k
Forks
196
PR merge metrics
No merged PRs in 30d

Description

**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:
```python
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.

Contributor guide

No contributing guide indexed for this repository

Research direction

Read keyring/backend.py around line 58 and inspect how the set_password wrapper forwards arguments. Reproduce the keyword call from the issue, then verify that set_password(service=..., username=..., password=...) works while positional behavior remains intact.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.