From 0e6d2811578d4f25b7df9f9b3d24928e662e9493 Mon Sep 17 00:00:00 2001 From: Matt Miller Date: Mon, 8 Jun 2026 19:04:33 -0700 Subject: [PATCH] fix(assets): normalize file_path separators to forward slashes on Windows get_asset_category_and_relative_path returned os.path.relpath output directly, which uses backslashes on Windows, producing logical paths like 'LLM\model.safetensors'. Normalize to '/' so the logical file_path is platform-independent, matching _compute_relative. Fixes test_path_utils failures on windows-2022. --- app/assets/services/path_utils.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/assets/services/path_utils.py b/app/assets/services/path_utils.py index c5dac295c..362e1ff44 100644 --- a/app/assets/services/path_utils.py +++ b/app/assets/services/path_utils.py @@ -211,7 +211,10 @@ def get_asset_category_and_relative_path( return root, rel combined = os.path.join(folder_name, rel) - return root, os.path.relpath(os.path.join(os.sep, combined), os.sep) + normalized = os.path.relpath(os.path.join(os.sep, combined), os.sep) + # Normalize to forward slashes so the logical path is identical across + # platforms (os.path.relpath emits backslashes on Windows). + return root, normalized.replace(os.sep, "/") def get_name_and_tags_from_asset_path(file_path: str) -> tuple[str, list[str]]: