diff --git a/keyring/core.py b/keyring/core.py index ef18128e..bbdb3e47 100644 --- a/keyring/core.py +++ b/keyring/core.py @@ -195,6 +195,6 @@ def _load_keyring_path(config: configparser.RawConfigParser) -> None: "load the keyring-path option (if present)" try: path = config.get("backend", "keyring-path").strip() - sys.path.insert(0, path) + sys.path.insert(0, os.path.expanduser(path)) except (configparser.NoOptionError, configparser.NoSectionError): pass diff --git a/newsfragments/696.feature.rst b/newsfragments/696.feature.rst new file mode 100644 index 00000000..7dd16761 --- /dev/null +++ b/newsfragments/696.feature.rst @@ -0,0 +1 @@ +When parsing ``keyring_path`` from the config, the home directory is now expanded from ``~``. \ No newline at end of file