I am able to add usernames to my gnome keyring that have characters A-Z a-z. However when I try to add a username with an ‘@’ symbol ‘[email protected]’, there is unexpected behavior.
The keyring does not error out, but executes the request normally. However when I use getpass to ask the keyring for the username, it returns my password. And when I ask for the password it returns nothing.
I have tried:
Wrapping username in single quotes, double quotes, escaping the @ symbol (”), using html for the special character %40. I tried using secretstorage to access the keyring directly. So far nothing has worked as needed.
The single quotes and double quotes return the quoted string enclosed in quotes.
'"[email protected]"'
The escape returns a double escape.
your-email\@domain.com
The html returns %40
because it’s not parsed. I need to have the ‘@’ symbol without parsing.
Here is the code I use to update:
dbus-run-session -- bash
source /home/linuxize/anaconda3/bin/activate
gnome-keyring-daemon --unlock
import keyring
import getpass
login_username = keyring.get_password('domain', getpass.getuser())
keyring.get_password('domain', login_username)
I have tried using every method to allow for a special character and I have also tried to access the keyring directly.
I would like to store the username and then return the username.
Mike-Canopy is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1