-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
{Packaging} Fix crash when another Python is installed on the system
Setting PYTHONPATH is done to avoid conflicts with other installations of Python on the same machine. When it is set incorrectly Python tends to crash on startup (typically when loading incompatible ctypes). There were old scripts in <base>/Scripts, which set PYTHONPATH so that Python prefers the bundled libs over the system ones. The problem with these scripts is that they set the wrong path. But these scripts no longer seem to be used. They were replaced by new ones in wbin. The problem with those is that PYTHONPATH was not set at all in them. Update the scripts to set PYTHONPATH correctly, both for bash and cmd. Fixes #28004, #29630, #30517, #30536, #30594, #30700, #30792.
- Loading branch information
Showing
5 changed files
with
9 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
#!/usr/bin/env bash | ||
|
||
AZ_INSTALLER=MSI "$(dirname "${BASH_SOURCE[0]}")/../python.exe" -IBm azure.cli "$@" | ||
SCRIPT_DIR=$(dirname "${BASH_SOURCE[0]}") | ||
export PYTHONPATH="$(dirname "$SCRIPT_DIR")" | ||
AZ_INSTALLER=MSI "$SCRIPT_DIR/../python.exe" -IBm azure.cli "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
@echo off | ||
setlocal | ||
|
||
SET PYTHONPATH=%~dp0\src;%PYTHONPATH% | ||
SET PYTHONPATH=%~dp0\..;%PYTHONPATH% | ||
SET AZ_INSTALLER=PIP | ||
|
||
IF EXIST "%~dp0\python.exe" ( | ||
"%~dp0\python.exe" -m azure.cli %* | ||
IF EXIST "%~dp0\..\python.exe" ( | ||
"%~dp0\..\python.exe" -m azure.cli %* | ||
) ELSE ( | ||
python -m azure.cli %* | ||
) |