From cffee311f425ad064fb23fc7e6b30e091b478f5f Mon Sep 17 00:00:00 2001
From: Steve Kowalik
Date: Thu, 15 Oct 2026 11:22:57 +1100
Subject: [PATCH 1/2] Correct docstrings about compress level change
Python 3.15 dropped the default compress level to 6, but 2 docstring
still state the default level is 9.
---
Lib/gzip.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/Lib/gzip.py b/Lib/gzip.py
index 247efc01527bb1..5b6ebcfef45c3a 100644
--- a/Lib/gzip.py
+++ b/Lib/gzip.py
@@ -39,7 +39,7 @@ def open(filename, mode="rb", compresslevel=_COMPRESS_LEVEL_TRADEOFF,
The mode argument can be "r", "rb", "w", "wb", "x", "xb", "a" or "ab"
for binary mode, or "rt", "wt", "xt" or "at" for text mode. The default
- mode is "rb", and the default compresslevel is 9.
+ mode is "rb", and the default compresslevel is 6.
For binary mode, this function is equivalent to the GzipFile
constructor: GzipFile(filename, mode, compresslevel). In this case,
@@ -186,7 +186,7 @@ def __init__(self, filename=None, mode=None,
The compresslevel argument is an integer from 0 to 9 controlling
the level of compression; 1 is fastest and produces the least
compression, and 9 is slowest and produces the most compression.
- 0 is no compression at all. The default is 9.
+ 0 is no compression at all. The default is 6.
The optional mtime argument is the timestamp requested by gzip.
The time is in Unix format, i.e., seconds since 00:00:00 UTC,
From 9fd9a36698fb01955d3c23e0708dbcd513b1a507 Mon Sep 17 00:00:00 2001
From: Stan Ulbrych
Date: Wed, 21 Oct 2026 19:10:18 +0100
Subject: [PATCH 2/2] Also fix `GZipFile` doc
---
Doc/library/gzip.rst | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Doc/library/gzip.rst b/Doc/library/gzip.rst
index 1fb3c5d44680f0..f32a54f0e35a02 100644
--- a/Doc/library/gzip.rst
+++ b/Doc/library/gzip.rst
@@ -112,7 +112,7 @@ The module defines the following items:
The *compresslevel* argument is an integer from ``0`` to ``9`` controlling
the level of compression; ``1`` is fastest and produces the least
compression, and ``9`` is slowest and produces the most compression. ``0``
- is no compression. The default is ``9``.
+ is no compression. The default is ``6``.
The optional *mtime* argument is the timestamp requested by gzip. The time
is in Unix format, i.e., seconds since 00:00:00 UTC, January 1, 1970. Set