Skip to content

Commit 92450f2

Browse files
sqlite3: Modernize documentation around unicode and bytes. (GH-28652) (GH-28695)
(cherry picked from commit 1dac95c) Co-authored-by: Julien Palard <[email protected]>
1 parent 52d9d3b commit 92450f2

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
@@ -513,8 +513,8 @@ Connection Objects
513513

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

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

0 commit comments

Comments
 (0)