diff options
author | Todd Gamblin <tgamblin@llnl.gov> | 2017-03-13 15:52:36 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-13 15:52:36 -0700 |
commit | d11e262b366eba85c51585c5352b1df129ecbdd9 (patch) | |
tree | ffac2637e197142ee24c87fcc034b949c217c93d /lib | |
parent | 9121599145162a37e20491f05b79f03f80fe2741 (diff) | |
download | spack-d11e262b366eba85c51585c5352b1df129ecbdd9.tar.gz spack-d11e262b366eba85c51585c5352b1df129ecbdd9.tar.bz2 spack-d11e262b366eba85c51585c5352b1df129ecbdd9.tar.xz spack-d11e262b366eba85c51585c5352b1df129ecbdd9.zip |
Fix from_sourcing_files(): decode json input as utf-8 (#3433)
Diffstat (limited to 'lib')
-rw-r--r-- | lib/spack/spack/environment.py | 6 |
1 files changed, 4 insertions, 2 deletions
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' |