Storing zlib compressed data in a BLOB field

Yi Qiang <[email protected]>
Newsgroups gmane.comp.python.db.pysqlite.user
Message-ID <[email protected]>
Hello,
I am trying to store a cPickled and then zlib compressed object in a  
BLOB field in my sqlite database.
This is the relevant line:
             cur.execute(query, (tuple_[1], sqlite3.Binary(tuple_[2])))
However, when I try to retrieve it back from the database, it appears  
to be of 'NoneType'.  Any idea what might be going wrong?  If I do  
not wrap it in sqlite3.Binary, it cuts off part of the data.  For  
example if what I put in is "'x\x9ck`\x8a-d\xd4\x03\x00\x06\x07\x01 
\x80'", what I get out is "'x\x9ck`\x8a-d\xd4\x03'"

Cheers,
Yi
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.