Skip to content

gh-152633: Fix outdated default compresslevel in gzip docs#152634

Open
Jaden-Varkey wants to merge 1 commit into
python:mainfrom
Jaden-Varkey:fix-gzip-default-compresslevel-docs
Open

gh-152633: Fix outdated default compresslevel in gzip docs#152634
Jaden-Varkey wants to merge 1 commit into
python:mainfrom
Jaden-Varkey:fix-gzip-default-compresslevel-docs

Conversation

@Jaden-Varkey

@Jaden-Varkey Jaden-Varkey commented Jun 29, 2026

Copy link
Copy Markdown

The default compresslevel for gzip.open(), the GzipFile constructor, and gzip.compress() is COMPRESS_LEVEL_TRADEOFF (6). The signatures and the "Changed in version" notes in Doc/library/gzip.rst already reflect this (it says "the default compression level was reduced to 6, down from 9").
However, a few places still state the default is 9 and should be updated:-

  1. the gzip.open() docstring in Lib/gzip.py
  2. the GzipFile.init docstring in Lib/gzip.py
  3. the GzipFile paragraph in Doc/library/gzip.rst

The default compression level for gzip.open(), the GzipFile constructor
and gzip.compress() was lowered from 9 to 6 (it now uses
_COMPRESS_LEVEL_TRADEOFF), and the signatures and versionchanged notes
were updated accordingly. A couple of docstrings and one paragraph in
the library docs still said the default was 9, which was misleading.
Update them to match the actual default of 6.
@python-cla-bot

python-cla-bot Bot commented Jun 29, 2026

Copy link
Copy Markdown

All commit authors signed the Contributor License Agreement.

CLA signed

@bedevere-app

bedevere-app Bot commented Jun 29, 2026

Copy link
Copy Markdown

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

@read-the-docs-community

Copy link
Copy Markdown

Documentation build overview

📚 cpython-previews | 🛠️ Build #33363117 | 📁 Comparing b6d2609 against main (edcc07d)

  🔍 Preview build  

1 file changed
± library/gzip.html

@Jaden-Varkey

Copy link
Copy Markdown
Author

This is a documentation-only change (two docstrings plus one paragraph in gzip.rst), so it shouldn't need a Misc/NEWS entry; could a skip news label be added? Appreciate it!

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