]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
sqlite3: Modernize documentation around unicode and bytes. (GH-28652) (GH-28695)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Tue, 5 Oct 2021 21:04:02 +0000 (14:04 -0700)
committerGitHub <noreply@github.com>
Tue, 5 Oct 2021 21:04:02 +0000 (23:04 +0200)
(cherry picked from commit 1dac95c814763eb8a53896ac4326d8d51895d43d)

Co-authored-by: Julien Palard <julien@palard.fr>
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 4936df5a27e2c052f9b76f46fb7a0330b6a677d6..aeedcbeffcf4e92f47ae0f9d7aab36d3396475df 100644 (file)
@@ -513,8 +513,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.