[Python-bugs-list] [ python-Bugs-640236 ] zlib.decompressobj under-described.

noreply@sourceforge.net noreply@sourceforge.net
Mon, 18 Nov 2002 10:48:51 -0800


Bugs item #640236, was opened at 2002-11-18 18:48
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=640236&group_id=5470

Category: Documentation
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Scott David Daniels (scott_daniels)
Assigned to: Fred L. Drake, Jr. (fdrake)
Summary: zlib.decompressobj under-described.

Initial Comment:
While trying to implement some decompression code,
(from reading the docs), I believed this was appropriate
code:

    dco = zlib.decompressionobj()
    for bytes in compressed_data:
        s = dco.decompress(bytes, limit)
        while s:
             handle_some_data(s)
             s = dco.decompress('', limit)

After eventually chasing back through the test_zlib.py
code, I now believe the proper analog of this code 
should be:

    dco = zlib.decompressionobj()
    for bytes in compressed_data:
        s = dco.decompress(bytes, limit)
        while s:
             handle_some_data(s)
             s = dco.decompress(
                      dco.unconsumed_tail,
                      limit)

The meaning of both unconsumed_tail and 
unused_data need a it of explanation in the docs.



----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=640236&group_id=5470