summaryrefslogtreecommitdiffstats
path: root/Doc/includes
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2009-05-20 18:31:14 (GMT)
committerGeorg Brandl <georg@python.org>2009-05-20 18:31:14 (GMT)
commit498a9b3491d85eb7d182af746059cd3adb377376 (patch)
tree2ffbe229c932d368ebbde6c6c1373b4e3b420a13 /Doc/includes
parent464432d1814efac1ad4a661719279888065282a0 (diff)
downloadcpython-498a9b3491d85eb7d182af746059cd3adb377376.zip
cpython-498a9b3491d85eb7d182af746059cd3adb377376.tar.gz
cpython-498a9b3491d85eb7d182af746059cd3adb377376.tar.bz2
#6055: refer to "sqlite3" consistently.
Diffstat (limited to 'Doc/includes')
-rw-r--r--Doc/includes/sqlite3/text_factory.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/Doc/includes/sqlite3/text_factory.py b/Doc/includes/sqlite3/text_factory.py
index 3e157a8..94a59da 100644
--- a/Doc/includes/sqlite3/text_factory.py
+++ b/Doc/includes/sqlite3/text_factory.py
@@ -13,7 +13,7 @@ cur.execute("select ?", (AUSTRIA,))
row = cur.fetchone()
assert row[0] == AUSTRIA
-# but we can make pysqlite always return bytestrings ...
+# but we can make sqlite3 always return bytestrings ...
con.text_factory = str
cur.execute("select ?", (AUSTRIA,))
row = cur.fetchone()
@@ -26,11 +26,12 @@ assert row[0] == AUSTRIA.encode("utf-8")
# here we implement one that will ignore Unicode characters that cannot be
# decoded from UTF-8
con.text_factory = lambda x: unicode(x, "utf-8", "ignore")
-cur.execute("select ?", ("this is latin1 and would normally create errors" + u"\xe4\xf6\xfc".encode("latin1"),))
+cur.execute("select ?", ("this is latin1 and would normally create errors" +
+ u"\xe4\xf6\xfc".encode("latin1"),))
row = cur.fetchone()
assert type(row[0]) == unicode
-# pysqlite offers a builtin optimized text_factory that will return bytestring
+# sqlite3 offers a builtin 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,))