From 3755ffbf83638b374ad50685067322499508199f Mon Sep 17 00:00:00 2001 From: Sam Winebrake <85908068+samwinebrake@users.noreply.github.com> Date: Sun, 24 Nov 2024 21:24:06 -0500 Subject: [PATCH] update paths for windows os --- brainio/fetch.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/brainio/fetch.py b/brainio/fetch.py index 89f7995..4494347 100644 --- a/brainio/fetch.py +++ b/brainio/fetch.py @@ -3,6 +3,7 @@ import logging import os import zipfile +import posixpath from pathlib import Path import boto3 @@ -58,12 +59,12 @@ def __init__(self, location, local_filename, version_id=None): virtual_hosted_style = 's3.' in parsed_url.hostname # s3. for virtual hosted style; s3- for older AWS if virtual_hosted_style: self.bucketname = parsed_url.hostname.split(".s3.")[0] - self.relative_path = os.path.join(*(split_path)) + self.relative_path = posixpath.join(*split_path) # ensure path uses / instead of \ else: self.bucketname = split_path[0] - self.relative_path = os.path.join(*(split_path[1:])) + self.relative_path = posixpath.join(*split_path[1:]) # ensure path uses / instead of \ self.extra_args = {"VersionId": version_id} if version_id else None - self.output_filename = os.path.join(self.local_dir_path, self.relative_path) + self.output_filename = os.path.join(self.local_dir_path, *self.relative_path.split('/')) self._logger = logging.getLogger(fullname(self)) def fetch(self):