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

[3.7] bpo-22490: Remove __PYVENV_LAUNCHER__ from environment during launch (GH-9516) #19111

Merged
merged 1 commit into from
Mar 22, 2020
Merged

[3.7] bpo-22490: Remove __PYVENV_LAUNCHER__ from environment during launch (GH-9516) #19111

merged 1 commit into from
Mar 22, 2020

Conversation

jaraco
Copy link
Member

@jaraco jaraco commented Mar 22, 2020

  • bpo-22490: Remove "PYVENV_LAUNCHER" from the shell environment on macOS

This changeset removes the environment varialbe "PYVENV_LAUNCHER"
during interpreter launch as it is only needed to communicate between
the stub executable in framework installs and the actual interpreter.

Leaving the environment variable present may lead to misbehaviour when
launching other scripts.

  • Actually commit the changes for issue 22490...

  • Correct typo

Co-Authored-By: Nicola Soranzo nicola.soranzo@gmail.com

  • Run make patchcheck

Co-authored-by: Jason R. Coombs jaraco@jaraco.com
Co-authored-by: Nicola Soranzo nicola.soranzo@gmail.com.
(cherry picked from commit 044cf94)

Co-authored-by: Ronald Oussoren ronaldoussoren@mac.com

https://bugs.python.org/issue22490

…aunch (GH-9516)

* bpo-22490: Remove "__PYVENV_LAUNCHER__" from the shell environment on macOS

This changeset removes the environment varialbe "__PYVENV_LAUNCHER__"
during interpreter launch as it is only needed to communicate between
the stub executable in framework installs and the actual interpreter.

Leaving the environment variable present may lead to misbehaviour when
launching other scripts.

* Actually commit the changes for issue 22490...

* Correct typo

Co-Authored-By: Nicola Soranzo <nicola.soranzo@gmail.com>

* Run make patchcheck

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
Co-authored-by: Nicola Soranzo <nicola.soranzo@gmail.com>.
(cherry picked from commit 044cf94)

Co-authored-by: Ronald Oussoren <ronaldoussoren@mac.com>
@telamonian
Copy link

Thanks for backporting this!

I stumbled accross this issue when I found yet another weird bug caused by __PYVENV_LAUNCHER__, which broke IPython kernels launched from a Jupyter server running in a venv. Because __PYVENV_LAUNCHER__ was polluting the environment when the Python process in the kernel started, include-system-site-packages = false could get picked up from the venv's pyvenv.cfg, which meant that the site-packages dir would get left off of sys.path for that kernel's Python instance.

For reference, which Python version did this first get included in? For me, upgrading from 3.7.6 -> 3.7.9 fixed the above issue.

@jaraco
Copy link
Member Author

jaraco commented Oct 13, 2020

Looks like it was added in 3.7.8rc1

@telamonian
Copy link

thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants