Conversation
Deleting an entry that is already absent is translated to KeyError by the existing mapping contract, but it is currently logged as an internal failure with a traceback. Log the expected condition at debug level while preserving error-level traceback logging for other keyring failures. Add regression assertions for both paths. Development disclosure: I developed this patch with material assistance from OpenAI Codex under my direction, then reviewed, tested, and signed the final change.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
KeyringBackendLinux._del_itemdeliberately translatesPasswordDeleteErrorintoKeyErrorwhen an entry is already absent, but first logs the expected condition as an internal failure with a traceback. This makes routine cleanup look like a backend fault and obscures actionable errors.Change
Log the already-absent condition at debug level without exception information. Preserve the existing
KeyErrorresult and retain error-level traceback logging for every otherKeyringError.Verification
KeyError, produces the diagnostic debug message, and emits no error-level record.ruff checkandgit diff --checkpass.No public API, storage format, provider selection, or authentication behavior changes.
Development disclosure: I developed this patch with material assistance from OpenAI Codex under my direction, then reviewed, tested, and signed the final change.