Fix from_sourcing_files(): decode json input as utf-8 (#3433)
This commit is contained in:
parent
9121599145
commit
d11e262b36
@ -310,8 +310,10 @@ def from_sourcing_files(*args, **kwargs):
|
|||||||
raise RuntimeError('sourcing files returned a non-zero exit code')
|
raise RuntimeError('sourcing files returned a non-zero exit code')
|
||||||
output = ''.join([line for line in proc.stdout])
|
output = ''.join([line for line in proc.stdout])
|
||||||
# Construct a dictionary with all the variables in the new environment
|
# Construct a dictionary with all the variables in the new environment
|
||||||
after_source_env = dict(json.loads(output))
|
after_source_env = dict(
|
||||||
this_environment = dict(os.environ)
|
(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
|
# Filter variables that are not related to sourcing a file
|
||||||
to_be_filtered = 'SHLVL', '_', 'PWD', 'OLDPWD'
|
to_be_filtered = 'SHLVL', '_', 'PWD', 'OLDPWD'
|
||||||
|
Loading…
Reference in New Issue
Block a user