From 863d0c1e4bc1d49ab1fa37ab5e7d7180af166d02 Mon Sep 17 00:00:00 2001 From: Eric Callahan Date: Sat, 3 Aug 2024 13:51:31 -0400 Subject: [PATCH] confighelper: don't resolve backup path If the configuration file is a symbolic link we want the backup generated in the config folder. Signed-off-by: Eric Callahan --- moonraker/confighelper.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/moonraker/confighelper.py b/moonraker/confighelper.py index b4dc8fd..3820a57 100644 --- a/moonraker/confighelper.py +++ b/moonraker/confighelper.py @@ -531,7 +531,7 @@ class ConfigHelper: def create_backup(self) -> None: cfg_path = self.server.get_app_args()["config_file"] - cfg = pathlib.Path(cfg_path).expanduser().resolve() + cfg = pathlib.Path(cfg_path).expanduser() backup = cfg.parent.joinpath(f".{cfg.name}.bkp") backup_fp: Optional[TextIO] = None try: @@ -1116,7 +1116,7 @@ def get_configuration( return ConfigHelper(server, source, 'server', {}) def find_config_backup(cfg_path: str) -> Optional[str]: - cfg = pathlib.Path(cfg_path).expanduser().resolve() + cfg = pathlib.Path(cfg_path).expanduser() backup = cfg.parent.joinpath(f".{cfg.name}.bkp") if backup.is_file(): return str(backup)