Skip to content

Commit 258c5fb

Browse files
sqlite3: Modernize documentation around unicode and bytes. (GH-28652) (GH-28694)
(cherry picked from commit 1dac95c) Co-authored-by: Julien Palard <[email protected]>
1 parent eb59e2f commit 258c5fb

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Doc/includes/sqlite3/text_factory.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
con = sqlite3.connect(":memory:")
44
cur = con.cursor()
55

6-
AUSTRIA = "\xd6sterreich"
6+
AUSTRIA = "Österreich"
77

8-
# by default, rows are returned as Unicode
8+
# by default, rows are returned as str
99
cur.execute("select ?", (AUSTRIA,))
1010
row = cur.fetchone()
1111
assert row[0] == AUSTRIA

Doc/library/sqlite3.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -528,8 +528,8 @@ Connection Objects
528528

529529
Using this attribute you can control what objects are returned for the ``TEXT``
530530
data type. By default, this attribute is set to :class:`str` and the
531-
:mod:`sqlite3` module will return Unicode objects for ``TEXT``. If you want to
532-
return bytestrings instead, you can set it to :class:`bytes`.
531+
:mod:`sqlite3` module will return :class:`str` objects for ``TEXT``.
532+
If you want to return :class:`bytes` instead, you can set it to :class:`bytes`.
533533

534534
You can also set it to any other callable that accepts a single bytestring
535535
parameter and returns the resulting object.

0 commit comments

Comments
 (0)