Message87699
This is not a bug. By default, pysqlite decodes all strings to Unicode,
assuming UTF-8 encoding (which SQLite assumes when parsing statements).
To override this default, you need to change the connection's text_factory:
py> import sqlite3
py> db = sqlite3.connect(':memory:')
py> db.text_factory = str
py> cur = db.cursor()
py> cur.execute("create table foo (x)")
<sqlite3.Cursor object at 0xb7cfb500>
py> cur.execute("insert into foo values ('café')")
<sqlite3.Cursor object at 0xb7cfb500>
py> cur.execute("select * from foo")
<sqlite3.Cursor object at 0xb7cfb500>
py> _.fetchall()
[('caf\xe9',)] |
|
Date |
User |
Action |
Args |
2009-05-13 18:37:34 | loewis | set | recipients:
+ loewis, amaury.forgeotdarc, izarf |
2009-05-13 18:37:34 | loewis | set | messageid: <1242239854.47.0.065819326354.issue6010@psf.upfronthosting.co.za> |
2009-05-13 18:37:32 | loewis | link | issue6010 messages |
2009-05-13 18:37:31 | loewis | create | |
|