Skip to content

gh-150167: Prevent successful import of bz2 under lazy_imports=all if _bz2 is unavailable - #157321

Open
DavidCEllis wants to merge 2 commits into
python:mainfrom
DavidCEllis:fix-lazy-all-archive-missing
Open

gh-150167: Prevent successful import of bz2 under lazy_imports=all if _bz2 is unavailable#157321
DavidCEllis wants to merge 2 commits into
python:mainfrom
DavidCEllis:fix-lazy-all-archive-missing

Conversation

@DavidCEllis

@DavidCEllis DavidCEllis commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Adds import _bz2; _bz2 to bz2.py which has the effect of making the import eager even under the 'all' lazy imports mode.

The import-ability of bz2 is used in some places to detect if the format is supported. The other compression formats all already use the relevant internal module at module level but bz2 does not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting review stdlib Standard Library Python modules in the Lib/ directory topic-lazy-imports

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant