web.py + sqlite: data coming out in unicode intermittently

37 views
Skip to first unread message

basica

unread,
Dec 28, 2012, 6:52:32 PM12/28/12
to we...@googlegroups.com
Hi there! :)

I just started messing around with Python and  web.py a few weeks ago and having fun but seem to have run into an issue I cannot figure out. I'm thinking this might be a real simple issue but I just can't figure it out and it's been driving me mad since yesterday :).

Basically, I set the text factory to:

db = web.database(dbn='sqlite', db='ak.db')
db.ctx.db.text_factory = str

So it wouldn't come out as unicode text (and thus my output would stop having the u' in front of it) but it only seems to work when I access that page directly. So, it's on /test and if I go to that page directly it works, but if I go to the index page and then navigate there, the output then reverts back to being unicode. Any assistance is greatly appreciated.
Reply all
Reply to author
Forward
0 new messages