Skip to content

bpo-46297: Fix interpreter crash on bootup with multiple PythonPaths set in registry#30466

Merged
zooba merged 1 commit into
python:mainfrom
darktohka:bpo-46297
Jan 7, 2022
Merged

bpo-46297: Fix interpreter crash on bootup with multiple PythonPaths set in registry#30466
zooba merged 1 commit into
python:mainfrom
darktohka:bpo-46297

Conversation

@darktohka

@darktohka darktohka commented Jan 7, 2022

Copy link
Copy Markdown
Contributor

This fixes the issue https://bugs.python.org/issue46297. Regression introduced in the 3.11 branch with commit 99fcf15 on Dec 3, 2021.

https://bugs.python.org/issue46297

Comment thread Modules/getpath.py Outdated

@zooba zooba left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me

@zooba

zooba commented Jan 7, 2022

Copy link
Copy Markdown
Member

It's interesting that we no longer use the default value of the "PythonPath" key itself. The old implementation in C used to include it when the skipcore argument was false, which was the case if calculate->home was NULL in the old calculate_module_search_path(). In other words, the default path from the registry was used as a fallback if the home landmark wasn't able to be found to set the prefix path.

@eryksun This will have been my oversight while doing the translation into Python. That said, I don't like that particular behaviour (any Python we install will locate its home already; another copy shouldn't rely on our install for a stdlib), so I'm happy to leave it out until someone shows a scenario that wouldn't be better off resolved in another way.

@zooba zooba merged commit c9dc1f4 into python:main Jan 7, 2022
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.

5 participants