From 7a6a88ef89c8ac3dca127cd24d97899e715fdf08 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Wed, 22 Oct 2025 10:04:52 +0000 Subject: [PATCH] Refactor: Use pathlib for cross-platform path handling Co-authored-by: junaid --- application_sdk/services/objectstore.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/application_sdk/services/objectstore.py b/application_sdk/services/objectstore.py index ab94d0233..89bf5c8b5 100644 --- a/application_sdk/services/objectstore.py +++ b/application_sdk/services/objectstore.py @@ -3,6 +3,7 @@ import json import os import shutil +from pathlib import Path from typing import List, Union import orjson @@ -422,6 +423,9 @@ async def download_prefix( store_name: Name of the Dapr object store binding to use. """ try: + # Convert destination to Path object for cross-platform compatibility + dest_path = Path(destination) + # List all files under the prefix file_list = await cls.list_files(source, store_name) @@ -429,7 +433,8 @@ async def download_prefix( # Download each file for file_path in file_list: - local_file_path = os.path.join(destination, file_path) + # Use Path for proper OS-independent path joining + local_file_path = str(dest_path / file_path) await cls.download_file(file_path, local_file_path, store_name) logger.info(f"Successfully downloaded all files from: {source}")