[Python-bugs-list] [ python-Bugs-640230 ] Discovered typo in zlib test.

noreply@sourceforge.net noreply@sourceforge.net
Tue, 19 Nov 2002 01:50:57 -0800


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

Category: None
Group: None
Status: Open
Resolution: None
>Priority: 6
Submitted By: Scott David Daniels (scott_daniels)
Assigned to: Nobody/Anonymous (nobody)
Summary: Discovered typo in zlib test.

Initial Comment:
In test_zlib.py (while chasing what appears to be a
documentation problem), I found a flaw in the code
that tests max_length limitted output from a 
decompression object test.

Starting at line 100, the existing code is:
...
bufs.append(deco.flush())
decomp2 = ''.join(buf)
if decomp2 != buf:
    print "max_length decompressobj failed"
else:
    print "max_length decompressobj succeeded"
...

This test will always succeed (''.join(str) == str).

What seems obviously meant is:
...
bufs.append(deco.flush())
decomp2 = ''.join(bufs)
if decomp2 != buf:
    print "max_length decompressobj failed"
else:
    print "max_length decompressobj succeeded"
...



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

>Comment By: Michael Hudson (mwh)
Date: 2002-11-19 09:50

Message:
Logged In: YES 
user_id=6656

Assuming Tim meant what he said, not what he did: raising
priority.

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

Comment By: Tim Peters (tim_one)
Date: 2002-11-18 20:56

Message:
Logged In: YES 
user_id=31435

Good eye!  Unfortunately, when I repair that, the test fails 
here -- decomp2 is a proper prefix of buf then.  It's "too 
short".  Raised priority but left unassigned (someone who 
understands zlib better will have to jump in).

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

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