diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2009-01-04 21:37:59 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2009-01-04 21:37:59 (GMT) |
commit | 42db3efd368d154f428ce834ebc99fc8535931d7 (patch) | |
tree | 84089486c7b867c60c97655821f15755a8bd8697 /Doc/library | |
parent | 315a20a6f3ae1365b7ab49ce8822a960f9a69733 (diff) | |
download | cpython-42db3efd368d154f428ce834ebc99fc8535931d7.zip cpython-42db3efd368d154f428ce834ebc99fc8535931d7.tar.gz cpython-42db3efd368d154f428ce834ebc99fc8535931d7.tar.bz2 |
Merged revisions 68319 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r68319 | antoine.pitrou | 2009-01-04 22:29:23 +0100 (dim., 04 janv. 2009) | 3 lines
Issue #4272: Add an optional argument to the GzipFile constructor to override the timestamp in the gzip stream.
........
Diffstat (limited to 'Doc/library')
-rw-r--r-- | Doc/library/gzip.rst | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/Doc/library/gzip.rst b/Doc/library/gzip.rst index c6f9ef8..fa73bba 100644 --- a/Doc/library/gzip.rst +++ b/Doc/library/gzip.rst @@ -24,7 +24,7 @@ For other archive formats, see the :mod:`bz2`, :mod:`zipfile`, and The module defines the following items: -.. class:: GzipFile([filename[, mode[, compresslevel[, fileobj]]]]) +.. class:: GzipFile([filename[, mode[, compresslevel[, fileobj[, mtime]]]]]) Constructor for the :class:`GzipFile` class, which simulates most of the methods of a file object, with the exception of the :meth:`readinto` and @@ -52,6 +52,15 @@ The module defines the following items: level of compression; ``1`` is fastest and produces the least compression, and ``9`` is slowest and produces the most compression. The default is ``9``. + The *mtime* argument is an optional numeric timestamp to be written to + the stream when compressing. All :program:`gzip`compressed streams are + required to contain a timestamp. If omitted or ``None``, the current + time is used. This module ignores the timestamp when decompressing; + however, some programs, such as :program:`gunzip`\ , make use of it. + The format of the timestamp is the same as that of the return value of + ``time.time()`` and of the ``st_mtime`` member of the object returned + by ``os.stat()``. + Calling a :class:`GzipFile` object's :meth:`close` method does not close *fileobj*, since you might wish to append more material after the compressed data. This also allows you to pass a :class:`StringIO` object opened for |