"char buffer type not available" error while gunzip

Istvan Gouritz istgou at googlemail.com
Mon Oct 11 13:16:55 EDT 2010


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



More information about the Python-list mailing list