Skip to content

Commit ef37746

Browse files
miss-islingtons-t-e-v-e-n-kStanFromIreland
authored
[3.15] gh-91349: Update gzip docs and docstrings for the default compresslevel of 6 (GH-159439) (#160096)
(cherry picked from commit 49aed47) Co-authored-by: Steve Kowalik <steven@wedontsleep.org> Co-authored-by: Stan Ulbrych <stan@python.org>
1 parent 713ecbf commit ef37746

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

‎Doc/library/gzip.rst‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ The module defines the following items:
105105
The *compresslevel* argument is an integer from ``0`` to ``9`` controlling
106106
the level of compression; ``1`` is fastest and produces the least
107107
compression, and ``9`` is slowest and produces the most compression. ``0``
108-
is no compression. The default is ``9``.
108+
is no compression. The default is ``6``.
109109

110110
The optional *mtime* argument is the timestamp requested by gzip. The time
111111
is in Unix format, i.e., seconds since 00:00:00 UTC, January 1, 1970. Set

‎Lib/gzip.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def open(filename, mode="rb", compresslevel=_COMPRESS_LEVEL_TRADEOFF,
3939
4040
The mode argument can be "r", "rb", "w", "wb", "x", "xb", "a" or "ab"
4141
for binary mode, or "rt", "wt", "xt" or "at" for text mode. The default
42-
mode is "rb", and the default compresslevel is 9.
42+
mode is "rb", and the default compresslevel is 6.
4343
4444
For binary mode, this function is equivalent to the GzipFile
4545
constructor: GzipFile(filename, mode, compresslevel). In this case,
@@ -185,7 +185,7 @@ def __init__(self, filename=None, mode=None,
185185
The compresslevel argument is an integer from 0 to 9 controlling
186186
the level of compression; 1 is fastest and produces the least
187187
compression, and 9 is slowest and produces the most compression.
188-
0 is no compression at all. The default is 9.
188+
0 is no compression at all. The default is 6.
189189
190190
The optional mtime argument is the timestamp requested by gzip.
191191
The time is in Unix format, i.e., seconds since 00:00:00 UTC,

0 commit comments

Comments
 (0)