From 2d0a7eb143f7dde6bc758691a741c0452775a852 Mon Sep 17 00:00:00 2001 From: "Fred N. Garvin" <184324400+FNGarvin@users.noreply.github.com> Date: Fri, 15 Nov 2024 13:19:41 -0600 Subject: [PATCH] cli.py: remove errant slash preventing the loading of user conf file(s) Hello, thanks for a great project. I am not a Python coder, but the official Python docs say of os.path.join that "if a segment is an absolute path, then all previous segments are ignored and joining continues from the absolute path segment". So, I expect "os.path.join(config_home, "/ramalama", "ramalama.conf")" to always elide the config_home (read: "~/.config") and fail to load user config files when XDG_CONFIG_HOME is not set. I do not believe this is the intended behavior. I suspect that removing the slash renders the code correct, but... I am not a Python coder. Works for me, but needs review, please. Best regards, FNG Signed-off-by: Fred N. Garvin, Esq. <184324400+FNGarvin@users.noreply.github.com> --- ramalama/cli.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ramalama/cli.py b/ramalama/cli.py index 2d13ec58..961a1c48 100644 --- a/ramalama/cli.py +++ b/ramalama/cli.py @@ -64,7 +64,7 @@ def load_config(): "/etc/ramalama/ramalama.conf", ] config_home = os.getenv("XDG_CONFIG_HOME", os.path.join("~", ".config")) - config_paths.extend([os.path.expanduser(os.path.join(config_home, "/ramalama", "ramalama.conf"))]) + config_paths.extend([os.path.expanduser(os.path.join(config_home, "ramalama", "ramalama.conf"))]) # Load configuration from each path for path in config_paths: