Bytes vs str trouble in user names and password
Some data type conversion trouble appears to lurk around (or else I am doing something terribly wrong)
System: Fedora 32, gnome-keyring-3.36.0, python-3.8.7, python3-keyring-21.8.0, mercurial-5.2, mercurial_keyring-1.4.0 (many thanks for fixing #69 (closed)!)
Symptoms:
hg incoming
(just like all similar operations) retrieves the password but is unable to use it. Mercurial prompts for the password but can't use the typed password, either, and keeps prompting.
Vague idea:
As far as I understand the code, mercurial_keyring uses bytes for user names and passwords. These values find their way to Mercurial proper, but strings seem to be expected there. As a quick test, I changed the return statement of find_user_password() in mercurial_keyring.py:613 to return b'myusername', b'mypassword'
, and it gives the aforementioned symptoms. However, return 'myusername', 'mypassword'
works just fine. (BTW, my password consists of letters and digits only, without any crazy upper-half ASCII or Unicode character.)
Thanks in advance for looking at this issue.