-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
{Packaging} Fix crash when another Python is installed on the system #30801
base: dev
Are you sure you want to change the base?
Conversation
️✔️AzureCLI-FullTest
|
️✔️AzureCLI-BreakingChangeTest
|
Thank you for your contribution! We will review the pull request and get back to you soon. |
The git hooks are available for azure-cli and azure-cli-extensions repos. They could help you run required checks before creating the PR. Please sync the latest code with latest dev branch (for azure-cli) or main branch (for azure-cli-extensions). pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>
|
Thank you for your contribution orgads! We will review the pull request and get back to you soon. |
At a glance, I have no idea why it adds However, this won't fix the issue. |
Oops, you're right. Fixed and tested this time - both on bash and cmd. |
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 Azure#28004, Azure#29630, Azure#30517, Azure#30536, Azure#30594, Azure#30700, Azure#30792.
Updated the commit message and the PR description accordingly. |
I guess ps1 script should also be updated, but it is signed, so I can't edit it. You can add this in the first line: $env:PYTHONPATH="$PSScriptRoot\..;$env:PYTHONPATH" |
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 /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.
This checklist is used to make sure that common guidelines for a pull request are followed.
The PR title and description has followed the guideline in Submitting Pull Requests.
I adhere to the Command Guidelines.
I adhere to the Error Handling Guidelines.