Skip to content
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Add descriptive comments.
  • Loading branch information
guzman-raphael committed Nov 8, 2019
commit 8573ef335cde364c197a8f265b13e6b401dcaa21
2 changes: 2 additions & 0 deletions datajoint/external.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,15 @@ def s3(self):

def _make_external_filepath(self, relative_filepath):
"""resolve the complete external path based on the relative path"""
# Strip root
if self.spec['protocol'] == 's3':
posix_path = PurePosixPath(PureWindowsPath(self.spec['location']))
location_path = Path(
*posix_path.parts[1:]) if any(
case in posix_path.parts[0] for case in (
'\\', ':')) else Path(posix_path)
return PurePosixPath(location_path, relative_filepath)
# Preserve root
elif self.spec['protocol'] == 'file':
return PurePosixPath(Path(self.spec['location']), relative_filepath)
else:
Expand Down