Skip to content

🐛 fix(create): patch zipped distutils on 3.9 - #3614

Merged
gaborbernat merged 2 commits into
pypa:mainfrom
gaborbernat:fix/zipped-distutils-hook
Nov 20, 2026
Merged

gaborbernat merged 2 commits into
pypa:mainfrom
gaborbernat:fix/zipped-distutils-hook

Conversation

@gaborbernat

@gaborbernat gaborbernat commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

The Python 3.9 distutils import hook patched modules loaded through exec_module, but a zipped standard library can load them through load_module. In that case configured install paths remained in place, so installs could use a location outside the environment. The hook now handles both loader methods. Fixes #3603.

Zipped standard library

The new loader path applies the same distutils patch after load_module returns. It leaves the existing exec_module path in place for loaders that expose it.

Behavior changes

Python 3.9 environments with a zipped standard library filter configured install paths as unpacked installations do.

Report ANT-2026-JULLCM9W.

@gaborbernat
gaborbernat merged commit 2198eb4 into pypa:main Nov 20, 2026
81 checks passed
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.

Python 3.9 distutils hook misses zipped standard library

1 participant