From d11e262b366eba85c51585c5352b1df129ecbdd9 Mon Sep 17 00:00:00 2001 From: Todd Gamblin Date: Mon, 13 Mar 2017 15:52:36 -0700 Subject: Fix from_sourcing_files(): decode json input as utf-8 (#3433) --- lib/spack/spack/environment.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/spack/spack/environment.py b/lib/spack/spack/environment.py index de30a9c7be..da69979ae1 100644 --- a/lib/spack/spack/environment.py +++ b/lib/spack/spack/environment.py @@ -310,8 +310,10 @@ class EnvironmentModifications(object): raise RuntimeError('sourcing files returned a non-zero exit code') output = ''.join([line for line in proc.stdout]) # Construct a dictionary with all the variables in the new environment - after_source_env = dict(json.loads(output)) - this_environment = dict(os.environ) + after_source_env = dict( + (k, v.decode('utf8')) for k, v in json.loads(output).items()) + this_environment = dict( + (k, v.decode('utf8')) for k, v in os.environ.items()) # Filter variables that are not related to sourcing a file to_be_filtered = 'SHLVL', '_', 'PWD', 'OLDPWD' -- cgit v1.2.3-60-g2f50