@@ -26,7 +26,7 @@ Note that additional file formats which can be decompressed by the
2626The module defines the following items:
2727
2828
29- .. function :: open(filename, mode='rb', compresslevel=9 , encoding=None, errors=None, newline=None)
29+ .. function :: open(filename, mode='rb', compresslevel=6 , encoding=None, errors=None, newline=None)
3030
3131 Open a gzip-compressed file in binary or text mode, returning a :term: `file
3232 object `.
@@ -59,6 +59,11 @@ The module defines the following items:
5959 .. versionchanged :: 3.6
6060 Accepts a :term: `path-like object `.
6161
62+ .. versionchanged :: next
63+ The default compression level was reduced to 6 (down from 9).
64+ It is the default level used by most compression tools and a better
65+ tradeoff between speed and performance.
66+
6267.. exception :: BadGzipFile
6368
6469 An exception raised for invalid gzip files. It inherits from :exc: `OSError `.
@@ -67,7 +72,7 @@ The module defines the following items:
6772
6873 .. versionadded :: 3.8
6974
70- .. class :: GzipFile(filename=None, mode=None, compresslevel=9 , fileobj=None, mtime=None)
75+ .. class :: GzipFile(filename=None, mode=None, compresslevel=6 , fileobj=None, mtime=None)
7176
7277 Constructor for the :class: `GzipFile ` class, which simulates most of the
7378 methods of a :term: `file object `, with the exception of the :meth: `~io.IOBase.truncate `
@@ -181,8 +186,13 @@ The module defines the following items:
181186 Remove the ``filename `` attribute, use the :attr: `~GzipFile.name `
182187 attribute instead.
183188
189+ .. versionchanged :: next
190+ The default compression level was reduced to 6 (down from 9).
191+ It is the default level used by most compression tools and a better
192+ tradeoff between speed and performance.
193+
184194
185- .. function :: compress(data, compresslevel=9 , *, mtime=0)
195+ .. function :: compress(data, compresslevel=6 , *, mtime=0)
186196
187197 Compress the *data *, returning a :class: `bytes ` object containing
188198 the compressed data. *compresslevel * and *mtime * have the same meaning as in
@@ -206,6 +216,10 @@ The module defines the following items:
206216 The *mtime * parameter now defaults to 0 for reproducible output.
207217 For the previous behaviour of using the current time,
208218 pass ``None `` to *mtime *.
219+ .. versionchanged :: next
220+ The default compression level was reduced to 6 (down from 9).
221+ It is the default level used by most compression tools and a better
222+ tradeoff between speed and performance.
209223
210224.. function :: decompress(data)
211225
0 commit comments