From 7aa2d49af9b7df2f3c33474d18900302d11eb175 Mon Sep 17 00:00:00 2001 From: Nicolas Brichet Date: Tue, 1 Oct 2024 14:14:22 +0200 Subject: [PATCH] Fix the export path when the server path uses '~' for home directory --- python/jupytergis_qgis/jupytergis_qgis/handlers.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/python/jupytergis_qgis/jupytergis_qgis/handlers.py b/python/jupytergis_qgis/jupytergis_qgis/handlers.py index 4de5d5d2..27551b59 100644 --- a/python/jupytergis_qgis/jupytergis_qgis/handlers.py +++ b/python/jupytergis_qgis/jupytergis_qgis/handlers.py @@ -39,7 +39,10 @@ def post(self): elif not virtual_file: raise HTTPError(400, "The file content is missing") - absolute_path = os.path.join(self.settings["server_root_dir"], path) + absolute_path = os.path.join( + os.path.expanduser(self.settings["server_root_dir"]), + path + ) logs = export_project_to_qgis(absolute_path, virtual_file) self.finish(json.dumps({ "exported": len(logs["errors"]) == 0,