From eae577f74c765ad3f089e1f23914f4eb65f99a43 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 8 May 2026 13:55:38 +0000 Subject: [PATCH] refactor(config): use pathlib for missing config creation Agent-Logs-Url: https://github.com/rommapp/romm/sessions/0c94e1c8-0f79-4f5f-a72b-e45832906d00 Co-authored-by: gantoine <3247106+gantoine@users.noreply.github.com> --- backend/config/config_manager.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/backend/config/config_manager.py b/backend/config/config_manager.py index 283ffbc5d..60ebeda6b 100644 --- a/backend/config/config_manager.py +++ b/backend/config/config_manager.py @@ -195,8 +195,9 @@ class ConfigManager: ) try: - os.makedirs(os.path.dirname(self.config_file), exist_ok=True) - Path(self.config_file).touch(exist_ok=True) + config_file = Path(self.config_file) + config_file.parent.mkdir(parents=True, exist_ok=True) + config_file.touch(exist_ok=True) self._config_file_mounted = True self._config_file_writable = os.access(self.config_file, os.W_OK)