FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-149504: Fix reentrant site startup processing by zsol · Pull Request #149516 · python/cpython · GitHub

Repository navigation

gh-149504: Fix reentrant site startup processing - #149516

Closed
zsol wants to merge 2 commits into
python:mainfrom
zsol:zsol/gh-149504-reentrant-site-startup
Closed

zsol wants to merge 2 commits into
python:mainfrom
zsol:zsol/gh-149504-reentrant-site-startup

Conversation

zsol commented May 7, 2026 •
edited by bedevere-app Bot
Loading

Copy link
Copy Markdown
Member

Copy and clear pending startup file data before executing import lines or .start entry points so recursive site.addsitedir() calls process a separate batch.

Fixes #149504

Copy and clear pending startup file data before executing import lines or .start entry points so recursive site.addsitedir() calls process a separate batch.

Copy link
Copy Markdown
Member

Updated to fix some failures we introduced on the main branch.

zsol marked this pull request as ready for review May 7, 2026 23:13
zsol requested a review from FFY00 as a code owner May 7, 2026 23:13

warsaw commented May 11, 2026

Copy link
Copy Markdown
Member

Thanks for this PR. I am working on a more comprehensive fix that is inspired by a suggestion @ncoghlan made on the original implementation PR: keeping a state-file that manages all .pth and .start file state internally. By doing this, we make it structurally impossible for reentrant calls to step on each other. I'll leave this PR open for now and we can compare. My PR will be larger and more complicated, but I think it's the right direction to go in because it also means fewer global state variables.

This file contains hidden or 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[3.15] Re-entrant calls to site.addsitedir() can fail (affecting uv run)

3 participants


Back | FazBrowse Home | New Git URL