dabo Commit
Revision 6494
Date: 2011-03-11 03:36:52 -0800 (Fri, 11 Mar 2011)
Author: Jacekk
Trac: http://trac.dabodev.com/changeset/6494
Changed:
U trunk/dabo/db/dDataSet.py
U trunk/dabo/db/dbSQLite.py
Log:
Fix for SQLite string decoding error.
Diff:
Modified: trunk/dabo/db/dDataSet.py
===================================================================
--- trunk/dabo/db/dDataSet.py 2011-03-08 14:29:07 UTC (rev 6493)
+++ trunk/dabo/db/dDataSet.py 2011-03-11 11:36:52 UTC (rev 6494)
@@ -352,7 +352,8 @@
self._connection = sqlite.connect(":memory:",
detect_types=(sqlite.PARSE_DECLTYPES|sqlite.PARSE_COLNAMES),
isolation_level="EXCLUSIVE")
- self._connection.text_factory = str
+ if not self._alreadyCorrectedFieldTypes:
+ 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-03-08 14:29:07 UTC (rev 6493)
+++ trunk/dabo/db/dbSQLite.py 2011-03-11 11:36:52 UTC (rev 6494)
@@ -73,8 +73,9 @@
# 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
-
+ # The statement above is true only conditionally, so we must
pay attention to this.
+ if not self._alreadyCorrectedFieldTypes:
+ self._connection.text_factory = str
self._connection.connectInfo = connectInfo
return self._connection
_______________________________________________
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]