"char buffer type not available" error while gunzip

Discussion in 'Python' started by Istvan Gouritz, Oct 11, 2010.

  1. Hello!

    I'm getting exception while trying to gunzip data, which is stored in
    db:
    File "helper.py", line 33, in gunzip
    f = StringIO(data)
    "exceptions.TypeError: char buffer type not available"

    function which does gunzipping:
    def gunzip(s):
    print type(data)) #prints <type 'buffer'>
    f = StringIO(s)
    gzipped = gzip.GzipFile(fileobj=f)
    return gzipped.read()

    It's weird, because it does not happen every time.
    Thanks a lot for any help!

    Istvan
    Istvan Gouritz, Oct 11, 2010
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Andreas Kuntzagk

    Re: how to gunzip a string ?

    Andreas Kuntzagk, Jul 31, 2003, in forum: Python
    Replies:
    0
    Views:
    439
    Andreas Kuntzagk
    Jul 31, 2003
  2. Bill Loren

    Re: how to gunzip a string ?

    Bill Loren, Jul 31, 2003, in forum: Python
    Replies:
    0
    Views:
    1,066
    Bill Loren
    Jul 31, 2003
  3. Replies:
    2
    Views:
    1,228
  4. flebber

    Gzip - gunzip using zlib

    flebber, Jun 9, 2007, in forum: Python
    Replies:
    2
    Views:
    338
    Stefan Behnel
    Jun 9, 2007
  5. none

    gunzip while downloading via ftp

    none, Feb 19, 2006, in forum: Perl Misc
    Replies:
    17
    Views:
    281
Loading...

Share This Page