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

gh-117505: Run ensurepip in isolated env in Windows installer #118257

Merged
merged 2 commits into from
May 22, 2024

Conversation

Vynce
Copy link
Contributor

@Vynce Vynce commented Apr 24, 2024

ensurepip forks a subprocess to run pip itself, but that subprocess only inherits a -I isolated mode flag (see _run_pip() in Lib/ensurepip/__init__.py), not the -E -s flags that the installer has been using. This means that parts of ensurepip don't actually run in an isolated environment and can make incorrect decisions based on packages installed in the user site-packages.

ensurepip forks a subprocess to run pip itself, but that subprocess only inherits a -I isolated mode flag (see _run_pip() in Lib/ensurepip/__init__.py), not the "-E -s" flags that the installer has been using. This means that parts of ensurepip don't actually run in an isolated environment and can make incorrect decisions based on packages installed in the user site-packages.
@Vynce Vynce requested a review from a team as a code owner April 24, 2024 22:40
Copy link

cpython-cla-bot bot commented Apr 24, 2024

All commit authors signed the Contributor License Agreement.
CLA signed

@bedevere-app
Copy link

bedevere-app bot commented Apr 24, 2024

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

@zooba
Copy link
Member

zooba commented Apr 24, 2024

Before we go straight to -I I'd want to understand/remember why I used -E -s in the first place. I don't have time to figure it out right now - will have to be next week.

@zooba
Copy link
Member

zooba commented May 22, 2024

I haven't been able to find any record of why -E -s was used, so I'll just assume that it could've been -I. We'll find out in the next 3.13 beta, and if it's not a problem, it can be backported later.

@zooba zooba merged commit c9073eb into python:main May 22, 2024
36 checks passed
@zooba zooba added the needs backport to 3.13 bugs and security fixes label May 22, 2024
@miss-islington-app
Copy link

Thanks @Vynce for the PR, and @zooba for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13.
🐍🍒⛏🤖

@zooba zooba added the needs backport to 3.12 bug and security fixes label May 22, 2024
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request May 22, 2024
…ythonGH-118257)

ensurepip forks a subprocess to run pip itself, but that subprocess only inherits a -I isolated mode flag (see _run_pip() in Lib/ensurepip/__init__.py), not the "-E -s" flags that the installer has been using. This means that parts of ensurepip don't actually run in an isolated environment and can make incorrect decisions based on packages installed in the user site-packages.
(cherry picked from commit c9073eb)

Co-authored-by: Michael Vincent <377567+Vynce@users.noreply.github.com>
@miss-islington-app
Copy link

Thanks @Vynce for the PR, and @zooba for merging it 🌮🎉.. I'm working now to backport this PR to: 3.12.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request May 22, 2024
…ythonGH-118257)

ensurepip forks a subprocess to run pip itself, but that subprocess only inherits a -I isolated mode flag (see _run_pip() in Lib/ensurepip/__init__.py), not the "-E -s" flags that the installer has been using. This means that parts of ensurepip don't actually run in an isolated environment and can make incorrect decisions based on packages installed in the user site-packages.
(cherry picked from commit c9073eb)

Co-authored-by: Michael Vincent <377567+Vynce@users.noreply.github.com>
@bedevere-app
Copy link

bedevere-app bot commented May 22, 2024

GH-119421 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.13 bugs and security fixes label May 22, 2024
@bedevere-app
Copy link

bedevere-app bot commented May 22, 2024

GH-119422 is a backport of this pull request to the 3.12 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.12 bug and security fixes label May 22, 2024
zooba pushed a commit that referenced this pull request May 22, 2024
)

ensurepip forks a subprocess to run pip itself, but that subprocess only inherits a -I isolated mode flag (see _run_pip() in Lib/ensurepip/__init__.py), not the "-E -s" flags that the installer has been using. This means that parts of ensurepip don't actually run in an isolated environment and can make incorrect decisions based on packages installed in the user site-packages.
(cherry picked from commit c9073eb)

Co-authored-by: Michael Vincent <377567+Vynce@users.noreply.github.com>
@Vynce Vynce deleted the isolated-ensurepip branch July 12, 2024 18:27
estyxx pushed a commit to estyxx/cpython that referenced this pull request Jul 17, 2024
…ythonGH-118257)

ensurepip forks a subprocess to run pip itself, but that subprocess only inherits a -I isolated mode flag (see _run_pip() in Lib/ensurepip/__init__.py), not the "-E -s" flags that the installer has been using. This means that parts of ensurepip don't actually run in an isolated environment and can make incorrect decisions based on packages installed in the user site-packages.
zooba pushed a commit that referenced this pull request Sep 18, 2024
)

ensurepip forks a subprocess to run pip itself, but that subprocess only inherits a -I isolated mode flag (see _run_pip() in Lib/ensurepip/__init__.py), not the "-E -s" flags that the installer has been using. This means that parts of ensurepip don't actually run in an isolated environment and can make incorrect decisions based on packages installed in the user site-packages.
(cherry picked from commit c9073eb)

Co-authored-by: Michael Vincent <377567+Vynce@users.noreply.github.com>
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.

2 participants