Author: phd
Date: 2007-11-27 11:15:21 -0700 (Tue, 27 Nov 2007)
New Revision: 3160
Modified:
SQLObject/branches/0.9/docs/News.txt
SQLObject/branches/0.9/sqlobject/sqlite/sqliteconnection.py
Log:
With PySQLite2 do not use encode()/decode() from PySQLite1 - always use base64 for BLOBs.
Modified: SQLObject/branches/0.9/docs/News.txt
===================================================================
--- SQLObject/branches/0.9/docs/News.txt 2007-11-27 18:14:56 UTC (rev 3159)
+++ SQLObject/branches/0.9/docs/News.txt 2007-11-27 18:15:21 UTC (rev 3160)
@@ -7,6 +7,11 @@
.. _start:
+SQLObject 0.9.3
+===============
+
+* A number of changes ported from `SQLObject 0.7.10`_.
+
SQLObject 0.9.2
===============
@@ -90,6 +95,11 @@
* idName can be inherited from the parent sqlmeta class.
+SQLObject 0.8.7
+===============
+
+* A number of changes ported from `SQLObject 0.7.10`_.
+
SQLObject 0.8.6
===============
@@ -272,6 +282,12 @@
* Fixed aggregators and accumulators with inheritance.
+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.9/sqlobject/sqlite/sqliteconnection.py
===================================================================
--- SQLObject/branches/0.9/sqlobject/sqlite/sqliteconnection.py 2007-11-27 18:14:56 UTC (rev 3159)
+++ SQLObject/branches/0.9/sqlobject/sqlite/sqliteconnection.py 2007-11-27 18:15:21 UTC (rev 3160)
@@ -1,3 +1,4 @@
+import base64
from sqlobject.dbconnection import DBAPI
from sqlobject.col import popKey
from sqlobject import col, sqlbuilder
@@ -36,6 +37,9 @@
except ImportError:
import sqlite
using_sqlite2 = False
+ if using_sqlite2:
+ sqlite.encode = base64.encodestring
+ sqlite.decode = base64.decodestring
self.module = sqlite
self.filename = filename # full path to sqlite-db-file
self._memory = filename == ':memory:'
@@ -55,15 +59,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
|