Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(13)

Side by Side Diff: Doc/library/gzip.rst

Issue 10639: reindent.py converts newlines to platform default
Patch Set: Created 8 years, 8 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Doc/library/functions.rst ('k') | Doc/library/html.entities.rst » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 :mod:`gzip` --- Support for :program:`gzip` files 1 :mod:`gzip` --- Support for :program:`gzip` files
2 ================================================= 2 =================================================
3 3
4 .. module:: gzip 4 .. module:: gzip
5 :synopsis: Interfaces for gzip compression and decompression using file objec ts. 5 :synopsis: Interfaces for gzip compression and decompression using file objec ts.
6 6
7 **Source code:** :source:`Lib/gzip.py` 7 **Source code:** :source:`Lib/gzip.py`
8 8
9 -------------- 9 --------------
10 10
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 The *compresslevel* argument is an integer from ``1`` to ``9`` controlling th e 54 The *compresslevel* argument is an integer from ``1`` to ``9`` controlling th e
55 level of compression; ``1`` is fastest and produces the least compression, an d 55 level of compression; ``1`` is fastest and produces the least compression, an d
56 ``9`` is slowest and produces the most compression. The default is ``9``. 56 ``9`` is slowest and produces the most compression. The default is ``9``.
57 57
58 The *mtime* argument is an optional numeric timestamp to be written to 58 The *mtime* argument is an optional numeric timestamp to be written to
59 the stream when compressing. All :program:`gzip` compressed streams are 59 the stream when compressing. All :program:`gzip` compressed streams are
60 required to contain a timestamp. If omitted or ``None``, the current 60 required to contain a timestamp. If omitted or ``None``, the current
61 time is used. This module ignores the timestamp when decompressing; 61 time is used. This module ignores the timestamp when decompressing;
62 however, some programs, such as :program:`gunzip`\ , make use of it. 62 however, some programs, such as :program:`gunzip`\ , make use of it.
63 The format of the timestamp is the same as that of the return value of 63 The format of the timestamp is the same as that of the return value of
64 ``time.time()`` and of the ``st_mtime`` attribute of the object returned 64 ``time.time()`` and of the ``st_mtime`` member of the object returned
65 by ``os.stat()``. 65 by ``os.stat()``.
66 66
67 Calling a :class:`GzipFile` object's :meth:`close` method does not close 67 Calling a :class:`GzipFile` object's :meth:`close` method does not close
68 *fileobj*, since you might wish to append more material after the compressed 68 *fileobj*, since you might wish to append more material after the compressed
69 data. This also allows you to pass a :class:`io.BytesIO` object opened for 69 data. This also allows you to pass a :class:`io.BytesIO` object opened for
70 writing as *fileobj*, and retrieve the resulting memory buffer using the 70 writing as *fileobj*, and retrieve the resulting memory buffer using the
71 :class:`io.BytesIO` object's :meth:`~io.BytesIO.getvalue` method. 71 :class:`io.BytesIO` object's :meth:`~io.BytesIO.getvalue` method.
72 72
73 :class:`GzipFile` supports the :class:`io.BufferedIOBase` interface, 73 :class:`GzipFile` supports the :class:`io.BufferedIOBase` interface,
74 including iteration and the :keyword:`with` statement. Only the 74 including iteration and the :keyword:`with` statement. Only the
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 import gzip 150 import gzip
151 s_in = b"Lots of content here" 151 s_in = b"Lots of content here"
152 s_out = gzip.compress(s_in) 152 s_out = gzip.compress(s_in)
153 153
154 .. seealso:: 154 .. seealso::
155 155
156 Module :mod:`zlib` 156 Module :mod:`zlib`
157 The basic data compression module needed to support the :program:`gzip` fi le 157 The basic data compression module needed to support the :program:`gzip` fi le
158 format. 158 format.
159 159
OLDNEW
« no previous file with comments | « Doc/library/functions.rst ('k') | Doc/library/html.entities.rst » ('j') | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+