Skip to content

Commit 128339f

Browse files
alireza787bclaude
andcommitted
fix(backend): normalize Windows backslash paths on Linux CI
Path("models\\yolo.pt") on Linux treats backslash as a literal filename character, not a separator. Explicitly replace backslashes before Path() construction so _normalize_model_path works cross-platform. Fixes the only failing CI test (test_normalize_model_path). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent d222b9d commit 128339f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/classes/backends/ultralytics_backend.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,9 @@ def _normalize_device_preference(device: str) -> str:
354354

355355
@staticmethod
356356
def _normalize_model_path(model_path: str) -> str:
357-
return str(Path(model_path).as_posix())
357+
# Replace Windows backslashes before Path() so Linux doesn't treat
358+
# them as literal filename characters.
359+
return str(Path(model_path.replace("\\", "/")).as_posix())
358360

359361
@staticmethod
360362
def _is_valid_ncnn_dir(model_path: str) -> bool:

0 commit comments

Comments
 (0)