bpo-46890: Fix setting of sys._base_executable with framework builds on macOS#31958
Conversation
…on macOS The side effect of this bug was that venv environments directly used the main interpreter instead of the intermediate stub executable, which can cause problems when a script uses system APIs that require the use of an application bundle.
zooba
left a comment
There was a problem hiding this comment.
LGTM. Couple of suggestions that might make it easier for reading/understanding the code, but nothing major.
|
I would like to review and play with the PR a bit but I likely won't be able to before Monday. If you don't hear anything by then, please go ahead. Thanks! |
* Ensure WITH_NEXT_FRAMEWORK is set unconditionally while running getpath.py * Remove duplicate code in the WITH_NEXT_FRAMEWORK case.
ned-deily
left a comment
There was a problem hiding this comment.
After spending some time reviewing and testing it, I am also not 100% confident that this is the best fix since this area is so complex but it does seem to work as advertised and does fix a serious problem with venvs in a framework environment. Since we are nearing the end of the alpha phase of 3.11, it's probably best to get this in now for more exposure. I pushed a fix for a few non-code typos. Since I have been sitting on this and with 3.11.0a7 going to be tagged very soon, I'll merge it now. Thanks, Ronald, and thanks, Steve, for diving into such murky waters.
The side effect of this bug was that venv environments directly
used the main interpreter instead of the intermediate stub executable,
which can cause problems when a script uses system APIs that
require the use of an application bundle.
https://bugs.python.org/issue46890