Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bpo-39505: delete the redundant '/' in $env:VIRTUAL_ENV #18290

Open
wants to merge 2 commits into
base: master
from

Conversation

@schwarzichet
Copy link

schwarzichet commented Jan 31, 2020

Copy from bpo-39505

When windows users use "python -m venv ENV_DIR", a python virtual environment will be created in ENV_DIR.
Powershell users use ENV_DIR\Scripts\Activate.ps1 to activate virtual environment.
In powershell, a environment variable, "$env:VIRTUAL_ENV", is set and used by many tools to determine that there is an activated venv. In bash, it is "$VIRTUAL_ENV"
In python3.8 and python3.9, $env:VIRTUAL_ENV has a redundant '/', for example:

PS C:\Users\Test> python -m venv test_venv
PS C:\Users\Test> .\test_venv\Scripts\Activate.ps1
PS C:\Users\Test> $env:VIRTUAL_ENV
C:\Users\Test\test_venv/

using python3.7, or using virtualenv with python3.8 or 3.9, or in linux, there will be no such a '/' in the end.

This '/' matters because many tools use this environment variable, for example, oh-my-posh will take "test_venv/" as virtual environment name rather than "test_venv"(Although venv's activate.ps1 itself's default prompt is correct). And from the perspective of semantics and consistency with other platform, the '/' is redundant.

https://bugs.python.org/issue39505

@schwarzichet schwarzichet requested a review from vsajip as a code owner Jan 31, 2020
@the-knights-who-say-ni

This comment has been minimized.

Copy link

the-knights-who-say-ni commented Jan 31, 2020

Hello, and thanks for your contribution!

I'm a bot set up to make sure that the project can legally accept this contribution by verifying everyone involved has signed the PSF contributor agreement (CLA).

CLA Missing

Our records indicate the following people have not signed the CLA:

@schwarzichet

For legal reasons we need all the people listed to sign the CLA before we can look at your contribution. Please follow the steps outlined in the CPython devguide to rectify this issue.

If you have recently signed the CLA, please wait at least one business day
before our records are updated.

You can check yourself to see if the CLA has been received.

Thanks again for the contribution, we look forward to reviewing it!

@schwarzichet

This comment has been minimized.

Copy link
Author

schwarzichet commented Jan 31, 2020

It seems that Misc/NEWS.d cannot contain ":VIRTUAL" ?
I'm not quite sure what to do

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.