From 65133daad76dd2a000d18843306dec1f9c0d2265 Mon Sep 17 00:00:00 2001 From: Oliver Breitwieser Date: Thu, 20 Feb 2020 00:30:17 +0100 Subject: 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 --- lib/spack/spack/relocate.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/spack/spack/relocate.py b/lib/spack/spack/relocate.py index 6847127efb..fb4ff18fae 100644 --- a/lib/spack/spack/relocate.py +++ b/lib/spack/spack/relocate.py @@ -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:])) -- cgit v1.2.3-60-g2f50