Skip to content

Commit f77371b

Browse files
committed
Added upper/lower case support for S3 prefix
1 parent 186d00a commit f77371b

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

nipype/interfaces/io.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,12 @@ def _check_s3_base_dir(self):
393393
sep = os.path.sep
394394
base_directory = self.inputs.base_directory
395395

396+
# Explicitly lower-case the "s3"
397+
if base_directory.lower().startswith(s3_str):
398+
base_dir_sp = base_directory.split('/')
399+
base_dir_sp[0] = base_dir_sp[0].lower()
400+
base_directory = '/'.join(base_dir_sp)
401+
396402
# Check if 's3://' in base dir
397403
if base_directory.startswith(s3_str):
398404
try:
@@ -559,6 +565,12 @@ def _upload_to_s3(self, src, dst):
559565
s3_str = 's3://'
560566
s3_prefix = os.path.join(s3_str, bucket.name)
561567

568+
# Explicitly lower-case the "s3"
569+
if dst.lower().startswith(s3_str):
570+
dst_sp = dst.split('/')
571+
dst_sp[0] = dst_sp[0].lower()
572+
dst = '/'.join(dst_sp)
573+
562574
# If src is a directory, collect files (this assumes dst is a dir too)
563575
if os.path.isdir(src):
564576
src_files = []

0 commit comments

Comments
 (0)