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

gh-150167: Make shutil compression probes eager by RaghunandanKumar · Pull Request #150279 · python/cpython · GitHub

Repository navigation

gh-150167: Make shutil compression probes eager - #150279

Closed
RaghunandanKumar wants to merge 1 commit into
python:mainfrom
RaghunandanKumar:fix-shutil-lazy-compression-probes
Closed

RaghunandanKumar wants to merge 1 commit into
python:mainfrom
RaghunandanKumar:fix-shutil-lazy-compression-probes

Conversation

Copy link
Copy Markdown

gh-150167

Make shutil detect compression-module support eagerly even when Python starts with -X lazy_imports=all.

This keeps _BZ2_SUPPORTED accurate when bz2 imports successfully but its _bz2 backend would fail once reified. The support probe now temporarily disables lazy imports while importing the compression module, and the regression test exercises that failure mode in a subprocess.

Testing

  • ./python.exe -m test test_shutil
  • ./python.exe -m test test_lazy_import
  • ./python.exe -X lazy_imports=all -S -c "import sys; sys.path.insert(0, TMPDIR); import shutil; print(shutil._BZ2_SUPPORTED)" (with a fake bz2 module whose _bz2 backend raises ImportError)

RaghunandanKumar force-pushed the fix-shutil-lazy-compression-probes branch from 02003bf to 66ab25f Compare May 22, 2026 22:14

picnixz commented May 23, 2026 •
edited
Loading

Copy link
Copy Markdown
Member

Please, don't open PRs when there is still no concrete plan on the issue already. We are still discussing what to do. More importantly, read https://devguide.python.org/ for future contributions especially https://devguide.python.org/getting-started/ai-tools/index.html.

picnixz closed this May 23, 2026
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.

2 participants


Back | FazBrowse Home | New Git URL