From 0cb37abffe3fa8f6138082898f0e3d958044256a Mon Sep 17 00:00:00 2001 From: Julian Stirling Date: Tue, 2 Jun 2026 15:02:56 +0100 Subject: [PATCH] Path checking: Ensure windows outputs original path when warning --- src/openflexure_microscope_server/utilities.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/openflexure_microscope_server/utilities.py b/src/openflexure_microscope_server/utilities.py index d57b7b43..558fac66 100644 --- a/src/openflexure_microscope_server/utilities.py +++ b/src/openflexure_microscope_server/utilities.py @@ -141,6 +141,7 @@ def _path_normalised(unsafe_path_string: str) -> bool: Warn and return false if . or .. is not at the start of the path. """ + original_path = unsafe_path_string # Ensure correct path separators before normalisation: if sys.platform.startswith("win"): unsafe_path_string = unsafe_path_string.replace("/", "\\") @@ -156,7 +157,7 @@ def _path_normalised(unsafe_path_string: str) -> bool: if normalised != unsafe_path_string: LOGGER.warning( - f"File path {unsafe_path_string} may be unsafe due to unexpected relative " + f"File path {original_path} may be unsafe due to unexpected relative " "navigation." ) return False