@@ -28,7 +28,7 @@ Note that additional file formats which can be decompressed by the
2828The module defines the following items:
2929
3030
31- .. function :: open(filename, mode='rb', compresslevel=6, encoding=None, errors=None, newline=None)
31+ .. function :: open(filename, mode='rb', compresslevel=6, encoding=None, errors=None, newline=None, *, mtime=None )
3232
3333 Open a gzip-compressed file in binary or text mode, returning a :term: `file
3434 object `.
@@ -43,9 +43,12 @@ The module defines the following items:
4343 The *compresslevel * argument is an integer from 0 to 9, as for the
4444 :class: `GzipFile ` constructor.
4545
46+ The keyword-only argument *mtime * represents a Unix timestamp.
47+
4648 For binary mode, this function is equivalent to the :class: `GzipFile `
47- constructor: ``GzipFile(filename, mode, compresslevel) ``. In this case, the
48- *encoding *, *errors * and *newline * arguments must not be provided.
49+ constructor: ``GzipFile(filename, mode, compresslevel, mtime=mtime) ``.
50+ In this case, the *encoding *, *errors * and *newline * arguments must not
51+ be provided.
4952
5053 For text mode, a :class: `GzipFile ` object is created, and wrapped in an
5154 :class: `io.TextIOWrapper ` instance with the specified encoding, error
@@ -66,6 +69,10 @@ The module defines the following items:
6669 It is the default level used by most compression tools and a better
6770 tradeoff between speed and performance.
6871
72+ .. versionchanged :: next
73+ Added keyword-only argument *mtime * which is passed to the class
74+ constructor of :class: `~gzip.GzipFile `.
75+
6976.. exception :: BadGzipFile
7077
7178 An exception raised for invalid gzip files. It inherits from :exc: `OSError `.
0 commit comments