From 964a1d59970b27105ca61684228f5b3309e00cdd Mon Sep 17 00:00:00 2001 From: Patrick Gartung Date: Tue, 4 Jun 2019 14:39:04 -0500 Subject: Buildcache relocate.py error fix (#11616) * Add a trailing / if file --mime does not return a mimetype with a / in it * Flake8 --- lib/spack/spack/relocate.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib') diff --git a/lib/spack/spack/relocate.py b/lib/spack/spack/relocate.py index fc653e825d..8277cca068 100644 --- a/lib/spack/spack/relocate.py +++ b/lib/spack/spack/relocate.py @@ -594,4 +594,6 @@ def mime_type(file): file_cmd = Executable('file') output = file_cmd('-b', '-h', '--mime-type', file, output=str, error=str) tty.debug('[MIME_TYPE] {0} -> {1}'.format(file, output.strip())) + if '/' not in output: + output += '/' return tuple(output.strip().split('/')) -- cgit v1.2.3-60-g2f50