-
-
Notifications
You must be signed in to change notification settings - Fork 159
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
Setting a blank password causes subsequent 'set' calls to fail #573
Comments
@AlexanderVatov this occurs in keyring/keyring/backends/macOS/api.py Line 150 in 977ed03
as seen below as you can see, the function find generic password fetches the password as '' . however, in python, empty strings resolve as False. The if statement therefore resolves as false and never deletes the password.error -25299 means that an item with this identifier already exists. Of course it throws this error, as the item was never deleted!
in your code it can be protected by ensuring set passwords are len() > 1, but looking into this issue now looking into this further. keyring.get_password has strange behaviour for getting empty passwords too. i think by luck it ends up being |
thanks for the super quick review and fix @jaraco, awesome stuff! just one question, would it be worth removing the |
Describe the bug
If a password is set to '', any subsequent attempts to set it to another value result in the following error:
To Reproduce
Expected behavior
One would expect set_password not to be affected by previous calls of set_password.
Environment
Python 3.8.9 on macOS
Additional context
Getting the blank password works fine. Deleting it and then setting it to any non-blank password also works as a workaround.
The text was updated successfully, but these errors were encountered: