Skip to content
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

Empty string username works in python 3.11 but returns None in python 3.12 (keyring 24.3.1) #668

Open
djkawa opened this issue Mar 7, 2024 · 3 comments
Labels

Comments

@djkawa
Copy link

djkawa commented Mar 7, 2024

Describe the bug:

Storing a password with an empty string "" username in windows 64, returns None with python 3.12.

To Reproduce:

All on windows 64, set up an environment with python 3.12 and keyring 24.3.1. Set a password with an empty string username "". Retrieve the password -> None.

Expected behavior
Doing the same thing with python 3.11, the password is retrieved.

Environment

Windows 64
Python 3.12.2
Keyring 24.3.1
@djkawa djkawa changed the title (Windows) Empty string username works in python 3.11 but returns None in python 3.12 (Windows) Empty string username works in python 3.11 but returns None in python 3.12 (keyring 24.3.1) Mar 7, 2024
@jaraco jaraco added the Windows label Mar 23, 2024
Repository owner deleted a comment from djkawa Mar 23, 2024
@jaraco jaraco changed the title (Windows) Empty string username works in python 3.11 but returns None in python 3.12 (keyring 24.3.1) Empty string username works in python 3.11 but returns None in python 3.12 (keyring 24.3.1) Mar 23, 2024
@jaraco
Copy link
Owner

jaraco commented Mar 23, 2024

On my Windows system, I see consistent behavior across Python versions:

 ~ # py -3.11 -m pip-run keyring -- -m keyring set system ''
Password for '' in 'system': 
 ~ # py -3.11 -m pip-run keyring -- -m keyring get system ''
 ~ # py -3.12 -m pip-run keyring -- -m keyring get system ''

I can confirm in credential manager that the password is being stored with an empty username. I'm unsure why it's not able to be retrieved.

@jaraco
Copy link
Owner

jaraco commented Mar 23, 2024

I'm not confident that empty usernames was ever supported. I searched the code and there are no tests guaranteeing that empty usernames work, so if they happened to work, it was a lucky accident. In bc34083, I added such a test, and it's failing right away (on Windows only), seemingly due to a failure to delete the password on cleanup.

More troubleshooting is called for. Can you tell me more about your use-case? How long have you been using empty usernames? Do you know why I've been unable to replicate your findings? What version of Python 3.11 do you have? Can you confirm that you have the latest keyring on both Python 3.11 and 3.12?

@djkawa
Copy link
Author

djkawa commented Mar 26, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants