Undocument and clean up sqlite3.OptimizedUnicode

Closes #13921.
This commit is contained in:
Petri Lehtinen 2012-02-09 21:09:03 +02:00
parent f0f9679d5c
commit bc35bebb45
10 changed files with 24 additions and 50 deletions

View file

@ -30,14 +30,3 @@ cur.execute("select ?", ("this is latin1 and would normally create errors" +
"\xe4\xf6\xfc".encode("latin1"),))
row = cur.fetchone()
assert type(row[0]) == str
# sqlite3 offers a built-in optimized text_factory that will return bytestring
# objects, if the data is in ASCII only, and otherwise return unicode objects
con.text_factory = sqlite3.OptimizedUnicode
cur.execute("select ?", (AUSTRIA,))
row = cur.fetchone()
assert type(row[0]) == str
cur.execute("select ?", ("Germany",))
row = cur.fetchone()
assert type(row[0]) == str