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

fix: fix launching Python 3.11 from <3.8 on macOS #1709

Merged

Conversation

armandomontanez
Copy link
Contributor

On macOS, some older versions of Python leak PYVENV_LAUNCHER into
the interpreter's environment variables. Starting with Python 3.11, this
causes problems with Python being able to start correctly when launched
from the Python bootstrap template. This change introduces a workaround
to prevent the problematic environment variable from leaking into
launched subprocesses.

I've verified this problem exists with the version of Python 3.7
included with Xcode, and there are reports of it also being an issue
with the Python 3.8 included with Xcode. Later versions of Python have
fixed this.

Context:

On macOS, some older versions of Python leak __PYVENV_LAUNCHER__ into
the interpreter's environment variables. Starting with Python 3.11, this
causes problems with Python being able to start correctly when launched
from the Python bootstrap template. This change introduces a workaround
to prevent the problematic environment variable from leaking into
launched subprocesses.

I've verified this problem exists with the version of Python 3.7
included with Xcode, and there are reports of it also being an issue
with the Python 3.8 included with Xcode. Later versions of Python have
fixed this.

Context:
- https://issues.pigweed.dev/310293060
- xonsh/xonsh#3576 (comment)
- pypa/virtualenv#1458
Copy link
Contributor

@rickeylev rickeylev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

per chat, I think this just needs to be updated to head, then CI will be happy. Otherwise LGTM

@rickeylev rickeylev added this pull request to the merge queue Jan 23, 2024
Merged via the queue into bazelbuild:main with commit e06b4ba Jan 23, 2024
3 checks passed
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

2 participants