[Python-3000] Zlib compress/decompress returning bytearray

Anand Balachandran Pillai abpillai at gmail.com
Sun Aug 3 21:50:05 CEST 2008


Hi,

  I have uploaded a patch for this which can be applied to
zlibmodule.c (issue #3492).
I have verified it works.

Thanks

--Anand

On Sat, Aug 2, 2008 at 3:08 AM, Benjamin Peterson
<musiccomposition at gmail.com> wrote:
> On Fri, Aug 1, 2008 at 4:29 PM, Anand Balachandran Pillai
> <abpillai at gmail.com> wrote:
>> Try this in Python 3.0 trunk.
>>
>>>>> import zlib
>>>>> s='This is a string'
>>>>> sc=zlib.compress(s)
>>>>> sc
>> bytearray(b'x\x9c\x0b\xc9\xc8,V\x00\xa2D\x85\xe2\x92\xa2\xcc\xbct\x00/\xc2\x05\xcd')
>>>>> zlib.decompress(sc)
>> bytearray(b'This is a string')
>>>>>
>>
>> This is wrong behavior as compress functions should return byte
>> ,not a bytearray. Same for decompress.
>>
>> Saw this while trying to write a patch for #3382.
>> Shall I file an issue ?
>
> Yes, please do.
>
>>
>> Thanks
>>
>> --
>> -Anand
>> _______________________________________________
>> Python-3000 mailing list
>> Python-3000 at python.org
>> http://mail.python.org/mailman/listinfo/python-3000
>> Unsubscribe: http://mail.python.org/mailman/options/python-3000/musiccomposition%40gmail.com
>>
>
>
>
> --
> Cheers,
> Benjamin Peterson
> "There's no place like 127.0.0.1."
>



-- 
-Anand


More information about the Python-3000 mailing list