Fix relocate.mime_type if slashes in subtype (#11788)
If the mimetype returned from `file -h -b --mime-type` contains slashes in its subtype, the tuple returned from `spack.relocate.mime_type` will have a size larger than two, which leads to errors. Change-Id: I31de477e69f114ffdc9ae122d00c573f5f749dbb
This commit is contained in:
parent
8825335056
commit
65133daad7
@ -749,4 +749,5 @@ def mime_type(file):
|
||||
tty.debug('[MIME_TYPE] {0} -> {1}'.format(file, output.strip()))
|
||||
if '/' not in output:
|
||||
output += '/'
|
||||
return tuple(output.strip().split('/'))
|
||||
split_by_slash = output.strip().split('/')
|
||||
return (split_by_slash[0], "/".join(split_by_slash[1:]))
|
||||
|
Loading…
Reference in New Issue
Block a user