summaryrefslogtreecommitdiffstats
path: root/Doc/library/gzip.rst
diff options
context:
space:
mode:
authorguoci <zguoci@gmail.com>2018-11-07 09:50:23 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2018-11-07 09:50:23 (GMT)
commit0e7497cb469b003a45a4abe4105b81ef6d0c4002 (patch)
tree6c14770bf03a79d5e2ce008432309cfbddab858e /Doc/library/gzip.rst
parentd2b11af91560eaaeb499f702f4b0f244ec756280 (diff)
downloadcpython-0e7497cb469b003a45a4abe4105b81ef6d0c4002.zip
cpython-0e7497cb469b003a45a4abe4105b81ef6d0c4002.tar.gz
cpython-0e7497cb469b003a45a4abe4105b81ef6d0c4002.tar.bz2
bpo-34898: Add mtime parameter to gzip.compress(). (GH-9704)
Without setting mtime, time.time() will be used as the timestamp which will end up in the compressed data and each invocation of the compress() function will vary over time.
Diffstat (limited to 'Doc/library/gzip.rst')
-rw-r--r--Doc/library/gzip.rst6
1 files changed, 4 insertions, 2 deletions
diff --git a/Doc/library/gzip.rst b/Doc/library/gzip.rst
index a57307b..8850a33 100644
--- a/Doc/library/gzip.rst
+++ b/Doc/library/gzip.rst
@@ -157,13 +157,15 @@ The module defines the following items:
Accepts a :term:`path-like object`.
-.. function:: compress(data, compresslevel=9)
+.. function:: compress(data, compresslevel=9, *, mtime=None)
Compress the *data*, returning a :class:`bytes` object containing
- the compressed data. *compresslevel* has the same meaning as in
+ the compressed data. *compresslevel* and *mtime* have the same meaning as in
the :class:`GzipFile` constructor above.
.. versionadded:: 3.2
+ .. versionchanged:: 3.8
+ Added the *mtime* parameter for reproducible output.
.. function:: decompress(data)