virtualenv: activate.sh fails if 'nounset' option is set
I get the following error when I try to activate a virtualenv.
$ source test-env/bin/activate
-bash: _OLD_VIRTUAL_PATH: unbound variable
This is happening because I’ve configured Bash to use the nounset option, which throws an error when accessing unset variables (see here)
About this issue
- Original URL
- State: closed
- Created 13 years ago
- Comments: 24 (9 by maintainers)
Commits related to this issue
- Workaround to virtual environment's nounset bug. Workaround to https://github.com/pypa/virtualenv/issues/150 — committed to Bioconductor/packagebuilder by b-long 9 years ago
- Workaround for this issue: https://github.com/pypa/virtualenv/issues/150 — committed to Burnetts/fair-ubuntu-centre by Burnetts 7 years ago
- Workaround for this issue: https://github.com/pypa/virtualenv/issues/150 — committed to fairdk/fair-ubuntu-centre by Burnetts 7 years ago
Workaround for now—
Actually, that’s a lame fix, since it requires rewriting all existential tests. It’s far easier to just add
set -o nounsetto the top of the script.