Python has great in-built support for all sorts of text compression
including bzip, gzip, tarfile and other general purpose modules like
zlib etc.
Of these, I have a gripe with gzip - it does not provide a simple
way of compressing/uncompressing a string like the other modules
to (namely bzip, zli
On Fri, Aug 01, 2008 at 07:27:38PM +0530, Anand Balachandran Pillai wrote:
> Of these, I have a gripe with gzip - it does not provide a simple
> way of compressing/uncompressing a string
It does. It is zlib.compress() and zlib.decompress().
Oleg.
--
Oleg Broytmannhttp://phd.p
On Fri, Aug 1, 2008 at 7:32 PM, Oleg Broytmann <[EMAIL PROTECTED]> wrote:
> On Fri, Aug 01, 2008 at 07:27:38PM +0530, Anand Balachandran Pillai wrote:
>> Of these, I have a gripe with gzip - it does not provide a simple
>> way of compressing/uncompressing a string
>
> It does. It is zlib.compress
Anand Balachandran Pillai gmail.com> writes:
>
> I think being able to send gzip compressed strings directly would be useful
> for applications which require to send gzip data over the wire without
> having to write to files and read-back.
I also think gzip.compress() and gzip.decompress() would
On Fri, Aug 1, 2008 at 8:57 AM, Anand Balachandran Pillai
<[EMAIL PROTECTED]> wrote:
> Python has great in-built support for all sorts of text compression
> including bzip, gzip, tarfile and other general purpose modules like
> zlib etc.
>
> Of these, I have a gripe with gzip - it does not provide
Hi Benjamin,
Filed http://bugs.python.org/issue3488.
Btw I have a fix ready for this, but I am not in the developer list and
do not have permissions for checkins.
Thanks
--Anand
On Fri, Aug 1, 2008 at 9:02 PM, Benjamin Peterson
<[EMAIL PROTECTED]> wrote:
> On Fri, Aug 1, 2008 at 8:57 AM, Ana
On Fri, Aug 1, 2008 at 12:59 PM, Anand Balachandran Pillai
<[EMAIL PROTECTED]> wrote:
> Hi Benjamin,
>
> Filed http://bugs.python.org/issue3488.
>
> Btw I have a fix ready for this, but I am not in the developer list and
> do not have permissions for checkins.
Great! Post the patch to the issue a
Sample file containing code (not a patch) posted to
the bug. If the code is fine, I will make a patch.
Thanks
--Anand
On Fri, Aug 1, 2008 at 11:34 PM, Benjamin Peterson
<[EMAIL PROTECTED]> wrote:
> On Fri, Aug 1, 2008 at 12:59 PM, Anand Balachandran Pillai
> <[EMAIL PROTECTED]> wrote:
>> Hi Benj
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
On Fri, Aug 1, 2008 at 4:29 PM, Anand Balachandran Pillai
<[EMAIL PROTECTED]> 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.decompr
Anand Balachandran Pillai schrieb:
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 compr
11 matches
Mail list logo