Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TEST ONLY #57

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions brainio/fetch.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import logging
import os
import zipfile
import posixpath
from pathlib import Path

import boto3
Expand Down Expand Up @@ -58,10 +59,10 @@ 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, os.path.basename(self.relative_path))
# Ensure the directory exists
Expand Down