dabo Commit
Revision 6627
Date: 2011-06-17 11:41:40 -0700 (Fri, 17 Jun 2011)
Author: Paul
Trac: http://trac.dabodev.com/changeset/6627

Changed:
U   trunk/dabo/db/dDataSet.py
U   trunk/dabo/db/dbSQLite.py

Log:
Reverted r6494 since it re-broke some of my customers' field decoding. Not sure 
what to do
to resolve all cases, Jacek, but I think the condition needs to be different.


Diff:
Modified: trunk/dabo/db/dDataSet.py
===================================================================
--- trunk/dabo/db/dDataSet.py   2011-06-16 12:37:40 UTC (rev 6626)
+++ trunk/dabo/db/dDataSet.py   2011-06-17 18:41:40 UTC (rev 6627)
@@ -366,6 +366,7 @@
                        if not hasattr(self, "_encoding"):
                                self._encoding = 
self._connection.execute("PRAGMA encoding"). \
                                                fetchone()[0].lower()
+                       self._connection.text_factory = str
                if self._cursor is None:
                        self._cursor = 
self._connection.cursor(factory=DictCursor)
 

Modified: trunk/dabo/db/dbSQLite.py
===================================================================
--- trunk/dabo/db/dbSQLite.py   2011-06-16 12:37:40 UTC (rev 6626)
+++ trunk/dabo/db/dbSQLite.py   2011-06-17 18:41:40 UTC (rev 6627)
@@ -72,6 +72,11 @@
 
                # Need to specify "isolation_level=None" to have transactions 
working correctly.
                self._connection = self.dbapi.connect(pth, 
factory=DictConnection, isolation_level=None)
+
+               # Non-utf8-encoded bytestrings could be in the database, and 
Dabo will try various encodings 
+               # to deal with it. So tell sqlite not to decode with utf-8, but 
to just return the bytes:
+               self._connection.text_factory = str
+
                self._connection.connectInfo = connectInfo
                if not hasattr(self, "_encoding"):
                        self._encoding = self._connection.execute("PRAGMA 
encoding"). \



_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev
Searchable Archives: http://leafe.com/archives/search/dabo-dev
This message: 
http://leafe.com/archives/byMID/[email protected]

Reply via email to