Skip to content

Commit cddb9c9

Browse files
committed
ENH(UX): warn user if keyring returned a "null" keyring
Happened to me: a number of days ago I had to workaround a pip issuehttps://github.com/pypa/pip/issues/7883 for which Q&D workaround was just to export PYTHON_KEYRING_BACKEND=keyring.backends.null.Keyring . Then I lived happily ever after (since 1-May?), probably even datalad download-url was just reusing prior cookies etc. But while troubleshooting earthdata data access, I was at WTF stage that datalad kept asking for credentials, and there were no visual feedback on a reason.
1 parent 6529f05 commit cddb9c9

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

datalad/support/keyring_.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,12 @@ def _keyring(self):
3737
lgr.debug("Importing keyring")
3838
import keyring
3939
self.__keyring = keyring
40-
40+
the_keyring = keyring.get_keyring()
41+
if the_keyring.name.lower().startswith('null '):
42+
lgr.warning(
43+
"Keyring module returned '%s', no credentials will be provided",
44+
the_keyring.name
45+
)
4146
return self.__keyring
4247

4348
@classmethod

0 commit comments

Comments
 (0)