diff options
author | Oliver Breitwieser <oliver.breitwieser@kip.uni-heidelberg.de> | 2020-02-20 00:30:17 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-19 17:30:17 -0600 |
commit | 65133daad76dd2a000d18843306dec1f9c0d2265 (patch) | |
tree | 1df19dfaaf468b067fd5dee0f93cfa497d51e97f /lib | |
parent | 8825335056c0c69f3ba2508b65b4d09c173da5e7 (diff) | |
download | spack-65133daad76dd2a000d18843306dec1f9c0d2265.tar.gz spack-65133daad76dd2a000d18843306dec1f9c0d2265.tar.bz2 spack-65133daad76dd2a000d18843306dec1f9c0d2265.tar.xz spack-65133daad76dd2a000d18843306dec1f9c0d2265.zip |
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
Diffstat (limited to 'lib')
-rw-r--r-- | lib/spack/spack/relocate.py | 3 |
1 files changed, 2 insertions, 1 deletions
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:])) |