Skip to content

sqlite3: Modernize documentation around unicode and bytes. #28652

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Doc/includes/sqlite3/text_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions Doc/library/sqlite3.rst
Original file line number Diff line number Diff line change
Expand Up @@ -537,8 +537,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.
Expand Down