On 10/19/2010 09:43 AM, Paul McNett wrote:
> My customer is getting this traceback while upgrading to the new version I
> released
> yesterday, based on Dabo r6097 and Python 2.6.5:
>
> Traceback (most recent call last):
> File "main.py", line 2, in<module>
> File "sbs_studio.pyo", line 96, in main
> File "App.pyo", line 1151, in openDatabase
> File "App.pyo", line 1199, in applyDbUpdates
> File "App.pyo", line 1190, in doUpdate
> File "db\updates\base.pyo", line 27, in process
> File "db\updates\u0009.pyo", line 38, in do_process
> File "dabo\biz\dBizobj.pyo", line 1837, in moveToRowNumber
> File "dabo\biz\dBizobj.pyo", line 2365, in _setRowNumber
> File "dabo\biz\dBizobj.pyo", line 1529, in requeryAllChildren
> File "dabo\biz\dBizobj.pyo", line 988, in requery
> File "dabo\db\dCursorMixin.pyo", line 460, in requery
> File "dabo\db\dCursorMixin.pyo", line 377, in execute
> <type 'exceptions.UnicodeDecodeError'>: 'ascii' codec can't decode byte 0xbd
> in
> position 85: ordinal not in range(128)
>
>
> Here's the relevant code in dCursorMixin (the error itself is raised on line
> 377):
>
> 369 try:
> 370 _records = self.fetchall()
> 371 except Exception, e:
> 372 _records = dabo.db.dDataSet()
> 373 # Database errors need to be decoded from database encoding.
> 374 try:
> 375 errMsg = ustr(e).decode(self.Encoding)
> 376 except UnicodeError:
> 377 errMsg = unicode(e)
> 378 dabo.log.error("Error fetching records: %s" % errMsg)
>
> I'm not boned-up enough on unicode encoding/decoding issues to know what to
> do. Other
> customers have upgraded just fine. This one customer is using the software in
> an
> unsupported way (putting the sqlite database on a network share and pointing
> multiple
> concurrent clients to it), so perhaps he's exposing something that wouldn't
> normally
> occur, but it could also be that we need to explicitly specify an encoding to
> the
> unicode(e) call...
>
> Paul
>
> _
Paul: I'm not sure this is the same error. I was parsing emails and
there was a unique character in the data that I was trying to save to my
sqlite table. The following code corrected the problem:
conn = sqlite.connect('data/mydb.db')
conn.text_factory = str
HTH
Jeff
-------------------
Jeff Johnson
[email protected]
_______________________________________________
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]