Skip to content

Suppress PasswordDeleteError in ChainerBackend.delete_password#744

Open
bysiber wants to merge 1 commit intojaraco:mainfrom
bysiber:fix-chainer-delete-password
Open

Suppress PasswordDeleteError in ChainerBackend.delete_password#744
bysiber wants to merge 1 commit intojaraco:mainfrom
bysiber:fix-chainer-delete-password

Conversation

@bysiber
Copy link

@bysiber bysiber commented Feb 21, 2026

Fixes #697.

When using ChainerBackend, deleting a password that only exists in a lower-priority backend fails because the higher-priority backend raises PasswordDeleteError and the chainer doesn't catch it.

For example, if kwallet (priority 5.1) doesn't hold the password but SecretService (priority 5) does, the delete propagates the PasswordDeleteError from kwallet without ever trying SecretService.

This adds PasswordDeleteError alongside the already-caught NotImplementedError in delete_password, so the chainer falls through to the next backend the same way it already does for set_password.

Added a test covering this scenario.

When deleting a password through ChainerBackend, if the
highest-priority backend raises PasswordDeleteError (because it
doesn't hold that particular password), the chainer now catches
the error and continues to the next backend instead of
propagating immediately.

This matches the existing pattern for NotImplementedError and
fixes the case where a password exists in a lower-priority
backend but cannot be deleted because a higher-priority backend
fails first.

Fixes jaraco#697
Copy link
Collaborator

@mitya57 mitya57 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think #740 addresses the same issue, doesn't it?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please don't commit this file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ChainerBackend not deleting password from lower priority backend

2 participants