[Python-checkins] sqlite3: Modernize documentation around unicode and bytes. (GH-28652) (GH-28694)

ambv webhook-mailer at python.org
Tue Oct 5 17:04:32 EDT 2021


https://github.com/python/cpython/commit/258c5fbbfd5b09d5ece629d7877d8753112f0f1c
commit: 258c5fbbfd5b09d5ece629d7877d8753112f0f1c
branch: 3.10
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: ambv <lukasz at langa.pl>
date: 2021-10-05T23:04:27+02:00
summary:

sqlite3: Modernize documentation around unicode and bytes. (GH-28652) (GH-28694)

(cherry picked from commit 1dac95c814763eb8a53896ac4326d8d51895d43d)

Co-authored-by: Julien Palard <julien at palard.fr>

files:
M Doc/includes/sqlite3/text_factory.py
M Doc/library/sqlite3.rst

diff --git a/Doc/includes/sqlite3/text_factory.py b/Doc/includes/sqlite3/text_factory.py
index a857a155cdd4f..c0d87cd559118 100644
--- a/Doc/includes/sqlite3/text_factory.py
+++ b/Doc/includes/sqlite3/text_factory.py
@@ -3,9 +3,9 @@
 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
diff --git a/Doc/library/sqlite3.rst b/Doc/library/sqlite3.rst
index d29e425cb9078..5641a347ceda1 100644
--- a/Doc/library/sqlite3.rst
+++ b/Doc/library/sqlite3.rst
@@ -528,8 +528,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.



More information about the Python-checkins mailing list