fix: Resovle windows file path issue

This commit is contained in:
Igor Ilic 2025-08-26 21:41:56 +02:00
parent 229a7a1db3
commit 9c31617c2f

View file

@ -10,8 +10,22 @@ def get_data_file_path(file_path: str):
# Normalize the file URI for Windows - replace backslashes with forward slashes
normalized_file_uri = os.path.normpath(pure_file_path)
# Convert path to proper file system path
if os.name == "nt": # Windows
# Handle Windows drive letters correctly
fs_path = normalized_file_uri
if (
(fs_path.startswith("/") or fs_path.startswith("\\"))
and len(fs_path) > 1
and fs_path[2] == ":"
):
fs_path = fs_path[1:]
else:
# Unix - like systems
fs_path = normalized_file_uri
# Now split the actual filesystem path
actual_fs_path = os.path.normpath(normalized_file_uri)
actual_fs_path = os.path.normpath(fs_path)
return actual_fs_path
elif file_path.startswith("s3://"):