-
-
Notifications
You must be signed in to change notification settings - Fork 526
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
Fix set_keychain errors #964
Conversation
I'm not as familiar with the keyring functionality, so I'll have to go through this with some more detail (I'm not sure I know why we are attempting to delete a password if one hasn't been set). As for adding a keyring dev dependency, I'm open to that (it seems like a good improvement for testing, too). Do you have suggestions for what the best keyring would be for devs and testing? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm good with the error message, but not sure about the change in functionality without adding some tests.
@wren The author must have realized this problem, and caught the exception if there was no password(namely I figured out a way to test with an environment with no keychain. I just made my own keyring backend and made is raise an exception every time the program tries to do anything with it. As for keyrings, including |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
* fix keyring problems * black * remove else and use stderr * black * add tests * black * change description of nokeyring * dumb syntax error
This is intended to close #851.
There are two problems with the current keyring system:
This pull request solves both of those problems.
Do note that that the new mechanism does not exit if a keyring backend is not found. This is because for whatever reason, the password seems to get corrupted/missing after the program crashes due to
keyring.errors.KeyringError
.The problem with not exiting is that if the editor is queued to pop up, the user never had an opportunity to see that their password didn't get saved. I would have just asked the user whether they wanted to continue or not, but this leads to the problem of what happens if they Ctrl-C out of that prompt. It also leads to some probably nasty scenario where you'd have to set a flag that we need to quit if the user chooses no, and then somehow finish the program without adding any text. I thought this was far too messy to be worth it.
This is very easy to test for me. The default poetry shell does not have a keyring. Perhaps we should include the
keyrings.cryptfile
package as a dev dependency?Checklist
for the same issue.