There is a bug in envstack.init() that is clearing env vars like PATH and PYTHONPATH if they are defined in the stack .env file, which means if they are referenced like this PATH: ${BIN}:%{PATH} then the values are cleared before they can be resolved
# clear vars from stack namespace
env = load_environ(name, environ=None)
for key in env.keys():
if key in os.environ:
del os.environ[key]
# store the name of the environment stack (e.g. for $PS1)
os.environ["ENVSTACK"] = name
# load the new environment
env = load_environ(name)
The same bug exists in the export and clear functions where it's unsetting env vars that are defined in the stack file, even if they existed in the old environment, e.g. PATH and PYTHONPATH:
There is a bug in envstack.init() that is clearing env vars like PATH and PYTHONPATH if they are defined in the stack .env file, which means if they are referenced like this
PATH: ${BIN}:%{PATH}
then the values are cleared before they can be resolvedThe same bug exists in the export and clear functions where it's unsetting env vars that are defined in the stack file, even if they existed in the old environment, e.g. PATH and PYTHONPATH:
Then PATH and PYTHONPATH get unset unintentionally:
when they should really be restored to the old values: