Skip to content

Commit 1dac95c

Browse files
authored
sqlite3: Modernize documentation around unicode and bytes. (GH-28652)
1 parent 833fdf1 commit 1dac95c

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
@@ -537,8 +537,8 @@ Connection Objects
537537

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

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

0 commit comments

Comments
 (0)