From 66dab172fecb118c0fc7b191763a28e071e14a58 Mon Sep 17 00:00:00 2001 From: "Andrew M. Kuchling" Date: Mon, 1 Mar 2010 19:51:43 +0000 Subject: [PATCH] #7191: describe more details of wbits parameter --- Doc/library/zlib.rst | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Doc/library/zlib.rst b/Doc/library/zlib.rst index 919b4e4ffd..7d9859bcdc 100644 --- a/Doc/library/zlib.rst +++ b/Doc/library/zlib.rst @@ -115,14 +115,18 @@ The available exception and functions in this module are: Decompresses the data in *string*, returning a string containing the uncompressed data. The *wbits* parameter controls the size of the window - buffer. If *bufsize* is given, it is used as the initial size of the output + buffer, and is discussed further below. + If *bufsize* is given, it is used as the initial size of the output buffer. Raises the :exc:`error` exception if any error occurs. The absolute value of *wbits* is the base two logarithm of the size of the history buffer (the "window size") used when compressing data. Its absolute value should be between 8 and 15 for the most recent versions of the zlib library, larger values resulting in better compression at the expense of greater - memory usage. The default value is 15. When *wbits* is negative, the standard + memory usage. When decompressing a stream, *wbits* must not be smaller + than the size originally used to compress the stream; using a too-small + value will result in an exception. The default value is therefore the + highest value, 15. When *wbits* is negative, the standard :program:`gzip` header is suppressed; this is an undocumented feature of the zlib library, used for compatibility with :program:`unzip`'s compression file format. -- 2.50.1