thanks I'll use your code. My python is very rusty and python3 has so many
changes.johnfSent from my T-Mobile 4G LTE Device
-------- Original message --------From: Ed Leafe <[email protected]> Date: 6/28/19
11:46 AM (GMT-07:00) To: Dabo developers' list <[email protected]> Subject:
Re: [dabo-dev] strange string as b('330') On Jun 28, 2019, at 12:30 PM, john
fabiani <[email protected]> wrote:> > I often use dataSet's in memory. Such
as 'dataDS.execute("select * from dataset order by pkid")' where dataDS = an
existing dataset. The issue becomes that for some reason the query returns a
value as "b('330')". Therefore, strVal becomes "b(330')" this causes
Decimal(strVal) to fail. I added the code below and it works.> > I don't have
a clue why or what is the root cause. But I wonder if some change has occurred
in sqlite for python3. I think this maybe only fixing a symptom.Python3 uses
bytes by default, and relies on the developer to handle the decoding. >
if isinstance(strVal, bytes):> strVal = strVal.decode("utf-8”)It
might be better to write this as: if isinstance(strVal, bytes):
strVal = strVal.decode(dabo.getEncoding())Other users may have a different
default encoding for their locale.-- Ed
Leafe_______________________________________________Post Messages to:
[email protected] Maintenance:
http://mail.leafe.com/mailman/listinfo/dabo-devSearchable Archives:
https://leafe.com/archivesThis message:
https://leafe.com/archives/byMID/[email protected]
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/dabo-dev
Searchable Archives: https://leafe.com/archives
This message:
https://leafe.com/archives/byMID/[email protected]