8000 Run ensurepip in isolated env in Windows installer · python/cpython@9f2c08b · GitHub
[go: up one dir, main page]

Skip to content
8000

Commit 9f2c08b

Browse files
author
Michael Vincent
committed
Run ensurepip in isolated env in Windows installer
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.
1 parent 4b10e20 commit 9f2c08b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Tools/msi/pip/pip.wxs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525
<?endif ?>
2626

2727
<!-- Install/uninstall pip -->
28-
<CustomAction Id="SetUpdatePipCommandLine" Property="UpdatePip" Value='"[PYTHON_EXE]" -E -s -m ensurepip -U --default-pip' Execute="immediate" />
29-
<CustomAction Id="SetRemovePipCommandLine" Property="UpdatePip" Value='"[PYTHON_EXE]" -E -s -B -m ensurepip._uninstall' Execute="immediate" />
28+
<CustomAction Id="SetUpdatePipCommandLine" Property="UpdatePip" Value='"[PYTHON_EXE]" -I -m ensurepip -U --default-pip' Execute="immediate" />
29+
<CustomAction Id="SetRemovePipCommandLine" Property="UpdatePip" Value='"[PYTHON_EXE]" -I -B -m ensurepip._uninstall' Execute="immediate" />
3030

3131
<InstallExecuteSequence>
3232
<Custom Action="SetUpdatePipCommandLine" Before="UpdatePip">(&amp;DefaultFeature=3) AND NOT (!DefaultFeature=3)</Custom>

0 commit comments

Comments
 (0)
0