(original) (raw)

changeset: 80384:735ef27fa231 branch: 2.7 user: Nadeem Vawda nadeem.vawda@gmail.com date: Sun Nov 11 13:52:10 2012 +0100 files: Doc/library/gzip.rst Doc/library/zlib.rst Lib/gzip.py Misc/ACKS Misc/NEWS description: Issue #15677: Document that zlib and gzip accept a compression level of 0 to mean 'no compression'. Patch by Brian Brazil. diff -r 2ca307556a7a -r 735ef27fa231 Doc/library/gzip.rst --- a/Doc/library/gzip.rst Sun Nov 11 02:01:56 2012 -0800 +++ b/Doc/library/gzip.rst Sun Nov 11 13:52:10 2012 +0100 @@ -49,9 +49,10 @@ 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`` to ``9`` controlling the - 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 *compresslevel* argument is an integer from ``0`` to ``9`` 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 diff -r 2ca307556a7a -r 735ef27fa231 Doc/library/zlib.rst --- a/Doc/library/zlib.rst Sun Nov 11 02:01:56 2012 -0800 +++ b/Doc/library/zlib.rst Sun Nov 11 13:52:10 2012 +0100 @@ -62,18 +62,19 @@ .. function:: compress(string[, level]) Compresses the data in *string*, returning a string contained compressed data. - *level* is an integer from ``1`` to ``9`` controlling the level of compression; + *level* is an integer from ``0`` to ``9`` controlling the level of compression; ``1`` is fastest and produces the least compression, ``9`` is slowest and - produces the most. The default value is ``6``. Raises the :exc:`error` - exception if any error occurs. + produces the most. ``0`` is no compression. The default value is ``6``. + 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 ``1`` to ``9`` controlling + fit into memory at once. *level* is an integer from ``0`` to ``9`` controlling the level of compression; ``1`` is fastest and produces the least compression, - ``9`` is slowest and produces the most. The default value is ``6``. + ``9`` is slowest and produces the most. ``0`` is no compression. The default + value is ``6``. .. function:: crc32(data[, value]) diff -r 2ca307556a7a -r 735ef27fa231 Lib/gzip.py --- a/Lib/gzip.py Sun Nov 11 02:01:56 2012 -0800 +++ b/Lib/gzip.py Sun Nov 11 13:52:10 2012 +0100 @@ -66,9 +66,10 @@ 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 + The compresslevel argument is an integer from 0 to 9 controlling the level of compression; 1 is fastest and produces the least compression, - and 9 is slowest and produces the most compression. The default is 9. + and 9 is slowest and produces the most compression. 0 is no compression + at all. The default is 9. The mtime argument is an optional numeric timestamp to be written to the stream when compressing. All gzip compressed streams diff -r 2ca307556a7a -r 735ef27fa231 Misc/ACKS --- a/Misc/ACKS Sun Nov 11 02:01:56 2012 -0800 +++ b/Misc/ACKS Sun Nov 11 13:52:10 2012 +0100 @@ -120,6 +120,7 @@ Georg Brandl Christopher Brannon Terrence Brannon +Brian Brazil Dave Brennan Tom Bridgman Keith Briggs diff -r 2ca307556a7a -r 735ef27fa231 Misc/NEWS --- a/Misc/NEWS Sun Nov 11 02:01:56 2012 -0800 +++ b/Misc/NEWS Sun Nov 11 13:52:10 2012 +0100 @@ -556,6 +556,9 @@ Documentation ------------- +- Issue #15677: Document that zlib and gzip accept a compression level of 0 to + mean 'no compression'. Patch by Brian Brazil. + - Issue #8040: added a version switcher to the documentation. Patch by Yury Selivanov. /nadeem.vawda@gmail.com