From d8adde63c9042ea17743191420cd97dc90bda4e2 Mon Sep 17 00:00:00 2001 From: Filippo Luca Ferretti <102977828+flferretti@users.noreply.github.com> Date: Mon, 4 Nov 2024 16:57:31 +0100 Subject: [PATCH 1/2] Raise error if a non-existing string-type path is passed --- src/adam/model/std_factories/std_model.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/adam/model/std_factories/std_model.py b/src/adam/model/std_factories/std_model.py index f82b6d0..15b72f1 100644 --- a/src/adam/model/std_factories/std_model.py +++ b/src/adam/model/std_factories/std_model.py @@ -36,7 +36,7 @@ def get_xml_string(path: str | pathlib.Path): # Checking if it is a path or an urdf if not isPath: - if len(path) <= MAX_PATH and os.path.exists(path): + if len(path) <= MAX_PATH: path = pathlib.Path(path) isPath = True else: From 53cbe103d1b41d08fdf788a63820d865fd3d96cb Mon Sep 17 00:00:00 2001 From: Filippo Luca Ferretti Date: Mon, 18 Nov 2024 12:01:50 +0100 Subject: [PATCH 2/2] Add additional check on path existance --- src/adam/model/std_factories/std_model.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/adam/model/std_factories/std_model.py b/src/adam/model/std_factories/std_model.py index 15b72f1..9f3a1dc 100644 --- a/src/adam/model/std_factories/std_model.py +++ b/src/adam/model/std_factories/std_model.py @@ -36,7 +36,7 @@ def get_xml_string(path: str | pathlib.Path): # Checking if it is a path or an urdf if not isPath: - if len(path) <= MAX_PATH: + if len(path) <= MAX_PATH and "