]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
sqlite3: Modernize documentation around unicode and bytes. (GH-28652)
authorJulien Palard <julien@palard.fr>
Fri, 1 Oct 2021 12:37:56 +0000 (14:37 +0200)
committerGitHub <noreply@github.com>
Fri, 1 Oct 2021 12:37:56 +0000 (14:37 +0200)
Doc/includes/sqlite3/text_factory.py
Doc/library/sqlite3.rst

index a857a155cdd4ff6f3f7793e9d0bd526615d52455..c0d87cd559118c4ae86528c3bbf039ef62eef473 100644 (file)
@@ -3,9 +3,9 @@ import sqlite3
 con = sqlite3.connect(":memory:")
 cur = con.cursor()
 
-AUSTRIA = "\xd6sterreich"
+AUSTRIA = "Österreich"
 
-# by default, rows are returned as Unicode
+# by default, rows are returned as str
 cur.execute("select ?", (AUSTRIA,))
 row = cur.fetchone()
 assert row[0] == AUSTRIA
index e6b8b95d2aa52e0cc242131a8aeb21e513016a63..eaea7ae390b9724240a7c4d71501093a2e0229ad 100644 (file)
@@ -537,8 +537,8 @@ Connection Objects
 
       Using this attribute you can control what objects are returned for the ``TEXT``
       data type. By default, this attribute is set to :class:`str` and the
-      :mod:`sqlite3` module will return Unicode objects for ``TEXT``. If you want to
-      return bytestrings instead, you can set it to :class:`bytes`.
+      :mod:`sqlite3` module will return :class:`str` objects for ``TEXT``.
+      If you want to return :class:`bytes` instead, you can set it to :class:`bytes`.
 
       You can also set it to any other callable that accepts a single bytestring
       parameter and returns the resulting object.