summaryrefslogtreecommitdiff
path: root/db.py
diff options
context:
space:
mode:
authorSylvain Th?nault <sylvain.thenault@logilab.fr>2009-12-22 17:36:26 +0100
committerSylvain Th?nault <sylvain.thenault@logilab.fr>2009-12-22 17:36:26 +0100
commita09986e5797b937d4ce90ba0dca423ac4e18eacc (patch)
tree0d42c3484561947ef2b014c9a4d1b44c6b12083b /db.py
parent46f1fb86d12a005d4ed11299fafda19bf4e7b7c1 (diff)
downloadlogilab-common-a09986e5797b937d4ce90ba0dca423ac4e18eacc.tar.gz
fix pysqlite2 support for the buffer type
Diffstat (limited to 'db.py')
-rw-r--r--db.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/db.py b/db.py
index c67cd21..2c40a94 100644
--- a/db.py
+++ b/db.py
@@ -357,6 +357,12 @@ class _PySqlite2Adapter(DBAPIAdapter):
return
sqlite._lc_initialized = 1
+ # XXX not clear why this is necessary while buffer (aka self.Binary)
+ # is pysqlite2 default binary type....
+ def adapt_buffer(buffer):
+ return str(buffer)
+ sqlite.register_adapter(self.Binary, adapt_buffer)
+
# bytea type handling
from StringIO import StringIO
def adapt_bytea(data):