Re: zlib.decompress cannot, gunzip can

2005-03-01 Thread enrio
Thanks, now the code is from cStringIO import StringIO from gzip import GzipFile ... body = GzipFile('','r',0,StringIO(body)).read() Regards, Enrique -- http://mail.python.org/mailman/listinfo/python-list

Re: zlib.decompress cannot, gunzip can

2005-02-28 Thread Dima Dorfman
On 2005-03-01, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > I have a string which I try to decompress: > > body = zlib.decompress(body) > > but I get > > zlib.error: Error -3 while decompressing data: incorrect header check > > However, I can write the string to a file and run gunzip with the

zlib.decompress cannot, gunzip can

2005-02-28 Thread enrio
I have a string which I try to decompress: body = zlib.decompress(body) but I get zlib.error: Error -3 while decompressing data: incorrect header check However, I can write the string to a file and run gunzip with the expected results: f = open('/tmp/bd.gz', 'w') f.write(body) f.clos