4

I have successfully installed Python keyring and use it with TortoiseHg on Windows but I am having a problem on Mac OS Mojave.

When performing a "push", I get "No handlers could be found for logger 'keyring.backend'". I did install the Python library and have modified the hgrc file to be as follows,

[ui]  
 username = xxx <[email protected]>

[paths]
#default = https://[email protected]/xxx/scan-namer-and-filer-repository-2
BitBucket = https://[email protected]/xxx/scan-namer-and-filer-repository-2

[tortoisehg]    
fullpath = True

[trusted]    
users = administrator, bcrow
groups = wheel

[extensions]   
mq =
mercurial_keyring =
hgext.mercurial_keyring = /Library/Python/2.7/site-packages/hgext/mercurial_keyring.py

[backend]

default-keyring=keyring.backends.OS_X.Keyring (priority: 5)

There seems to be little help for Mac OS users. I don't even know if this is a warning or an error which should cause me concern.

Could someone provide guidance or references?

Responses to comments and answer

  1. I added the "mercurial_keyring =" before I discovered that keyring is NOT distributed with the MacOS version of Tortoise HG. I agree it should be removed.

  2. The full text of the error message is "No handlers could be found for logger "keyring.backend" - That's it. Nothing about passwords.

  3. I was not able to put "[backend] in the keyringrc.cfg file because it was not properly created by the Python installation.

  4. Fortunately, I found https://stackoverflow.com/questions/54192177/how-can-i-get-the-keyring-extension-working-for-mercurial-in-ubuntu-18-04

    which told me how to create the necessary folders and the keyringrc.cfg file on MacOS.

I removed the "[backend]" line from the hgrc file.
Push still does not work without entering authentication information. Don't know where to go from here.

The current version of the hgrc (redacted) is as follows,

[ui]
username = xxx

[paths]
BitBucket = https://[email protected]/xxx/scan-namer-and-filer-repository-2

[tortoisehg]
fullpath = True

[trusted]
users = xxxx, xxxx groups = wheel

[extensions]
mq =
hgext.mercurial_keyring = /Library/Python/2.7/site-packages/hgext/mercurial_keyring.py

1 Answer 1

0
  1. I see 2 different mercurial_keyring extensions in your config, while only one (bundled with THG) is needed
  2. This is error, because full text of message is

No handlers could be found for logger "keyring.backend" Please enter password for encrypted keyring

and without it you'll not get access to stored in your keyring passwords

  1. [backend] section (with content) have to be a part of keyringrc.cfg in appropriate location, not Mercurial's
2
  • And JFYI medium.com/@kaikoenig/… (yes, Ubuntu, but not for OS-specific problem) Commented Jul 11, 2019 at 1:23
  • What is the "appropriate location" for keyringrc.cfg?
    – O'Rooney
    Commented Oct 19, 2022 at 3:49

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .