Skip to content

🐛 fix(create): preserve reported sys.path in safe-path mode - #3748

Merged
gaborbernat merged 2 commits into
pypa:mainfrom
gaborbernat:rework/pr-3698
Nov 20, 2026
Merged

gaborbernat merged 2 commits into
pypa:mainfrom
gaborbernat:rework/pr-3698

Conversation

@gaborbernat

@gaborbernat gaborbernat commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

The -vv debug report and Creator.debug could drop the first configured import path when the target interpreter used PYTHONSAFEPATH or a Windows ._pth file. This made a valid environment appear to be missing part of its search path. Fixes #3584.

The target interpreter now uses its own startup flags when reporting sys.path. During ordinary startup it omits the directory Python added to run the probe. In safe-path or isolated mode Python skips that addition, so the report keeps every configured entry.

Contribution by Pratik-Kumar-Dhakar.

@gaborbernat
gaborbernat marked this pull request as ready for review November 20, 2026 18:08
@gaborbernat
gaborbernat marked this pull request as draft November 20, 2026 20:49
@gaborbernat
gaborbernat marked this pull request as ready for review November 20, 2026 22:05
@gaborbernat
gaborbernat merged commit 4b69a11 into pypa:main Nov 20, 2026
81 checks passed
@gaborbernat
gaborbernat deleted the rework/pr-3698 branch November 23, 2026 18:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PYTHONSAFEPATH makes the target debug report drop the first real sys.path entry

1 participant