Author: phd
Date: 2007-11-27 11:13:38 -0700 (Tue, 27 Nov 2007)
New Revision: 3158
Modified:
SQLObject/branches/0.7/docs/News.txt
SQLObject/branches/0.7/sqlobject/sqlite/sqliteconnection.py
Log:
With PySQLite2 do not use encode()/decode() from PySQLite1 - always use base64 for BLOBs.
Modified: SQLObject/branches/0.7/docs/News.txt
===================================================================
--- SQLObject/branches/0.7/docs/News.txt 2007-11-20 17:52:04 UTC (rev 3157)
+++ SQLObject/branches/0.7/docs/News.txt 2007-11-27 18:13:38 UTC (rev 3158)
@@ -7,6 +7,12 @@
.. _start:
+SQLObject 0.7.10
+================
+
+* With PySQLite2 do not use encode()/decode() from PySQLite1 - always use
+ base64 for BLOBs.
+
SQLObject 0.7.9
===============
Modified: SQLObject/branches/0.7/sqlobject/sqlite/sqliteconnection.py
===================================================================
--- SQLObject/branches/0.7/sqlobject/sqlite/sqliteconnection.py 2007-11-20 17:52:04 UTC (rev 3157)
+++ SQLObject/branches/0.7/sqlobject/sqlite/sqliteconnection.py 2007-11-27 18:13:38 UTC (rev 3158)
@@ -1,3 +1,4 @@
+import base64
from sqlobject.dbconnection import DBAPI
from sqlobject.col import popKey
import thread
@@ -18,6 +19,8 @@
if sqlite is None:
try:
from pysqlite2 import dbapi2 as sqlite
+ sqlite.encode = base64.encodestring
+ sqlite.decode = base64.decodestring
using_sqlite2 = True
except ImportError:
import sqlite
@@ -41,15 +44,6 @@
for col_type in "text", "char", "varchar", "date", "time", "datetime", "timestamp":
sqlite.register_converter(col_type, stop_pysqlite2_converting_strings)
sqlite.register_converter(col_type.upper(), stop_pysqlite2_converting_strings)
- try:
- from sqlite import encode, decode
- except ImportError:
- import base64
- sqlite.encode = base64.encodestring
- sqlite.decode = base64.decodestring
- else:
- sqlite.encode = encode
- sqlite.decode = decode
global sqlite2_Binary
if sqlite2_Binary is None:
sqlite2_Binary = sqlite.Binary
|