[issue38583] The activate script in Windows is not correct for venvs created in git-bash

Mo report at bugs.python.org
Fri Oct 25 04:18:19 EDT 2019


Mo <moabrahams at dashavoo.com> added the comment:

The issue comes as a result of abspath on line 59 of venv/__init__.py:
        env_dir = os.path.abspath(env_dir)

This returns a Windows-style path, and os.path.abspath returning in this way is *probably* correct, as the OS is Windows, despite trying to forget that by using bash.

It is still my view that the activate script is a bash script, and therefore should only contain paths in that style, but the simple solution to this issue is to change the double quotes around the definition of $VIRTUAL_ENV in the activate script to single quotes. It works. The output of "which python" is a bit odd, but this is clearly a quirk beyond Python's control.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue38583>
_______________________________________


More information about the Python-bugs-list mailing list