cpython: 735ef27fa231 (original) (raw)
Mercurial > cpython
changeset 80384:735ef27fa231 2.7
Issue #15677: Document that zlib and gzip accept a compression level of 0 to mean 'no compression'. Patch by Brian Brazil. [#15677]
Nadeem Vawda nadeem.vawda@gmail.com | |
---|---|
date | Sun, 11 Nov 2012 13:52:10 +0100 |
parents | 2ca307556a7a |
children | f6c4c178da56 |
files | Doc/library/gzip.rst Doc/library/zlib.rst Lib/gzip.py Misc/ACKS Misc/NEWS |
diffstat | 5 files changed, 17 insertions(+), 10 deletions(-)[+] [-] Doc/library/gzip.rst 7 Doc/library/zlib.rst 11 Lib/gzip.py 5 Misc/ACKS 1 Misc/NEWS 3 |
line wrap: on
line diff
--- a/Doc/library/gzip.rst +++ b/Doc/library/gzip.rst @@ -49,9 +49,10 @@ The module defines the following items: not given, the 'b' flag will be added to the mode to ensure the file is opened in binary mode for cross-platform portability.
- The compresslevel argument is an integer from
1
to9
controlling the - level of compression;
1
is fastest and produces the least compression, and 9
is slowest and produces the most compression. The default is9
.
- The compresslevel argument is an integer from
0
to9
controlling - the level of compression;
1
is fastest and produces the least - compression, and
9
is slowest and produces the most compression.0
- is no 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
--- a/Doc/library/zlib.rst +++ b/Doc/library/zlib.rst @@ -62,18 +62,19 @@ The available exception and functions in .. function:: compress(string[, level]) Compresses the data in string, returning a string contained compressed data.
- level is an integer from
0
to9
controlling the level of compression;1
is fastest and produces the least compression,9
is slowest and
- produces the most.
0
is no compression. The default value is6
. - Raises the :exc:
error
exception if any error occurs.
.. function:: compressobj([level]) Returns a compression object, to be used for compressing data streams that won't
- fit into memory at once. level is an integer from
0
to9
controlling the level of compression;1
is fastest and produces the least compression,
.. function:: crc32(data[, value])
--- a/Lib/gzip.py +++ b/Lib/gzip.py @@ -66,9 +66,10 @@ class GzipFile(io.BufferedIOBase): Be aware that only the 'rb', 'ab', and 'wb' values should be used for cross-platform portability.
The compresslevel argument is an integer from 1 to 9 controlling the[](#l3.7)
The compresslevel argument is an integer from 0 to 9 controlling the[](#l3.8) level of compression; 1 is fastest and produces the least compression,[](#l3.9)
and 9 is slowest and produces the most compression. The default is 9.[](#l3.10)
and 9 is slowest and produces the most compression. 0 is no compression[](#l3.11)
at all. The default is 9.[](#l3.12)
The mtime argument is an optional numeric timestamp to be written to the stream when compressing. All gzip compressed streams
--- a/Misc/ACKS +++ b/Misc/ACKS @@ -120,6 +120,7 @@ Monty Brandenberg Georg Brandl Christopher Brannon Terrence Brannon +Brian Brazil Dave Brennan Tom Bridgman Keith Briggs
--- a/Misc/NEWS +++ b/Misc/NEWS @@ -556,6 +556,9 @@ Tools/Demos Documentation ------------- +- Issue #15677: Document that zlib and gzip accept a compression level of 0 to