]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.12] gh-118221: Always use the default row factory in sqlite3.iterdump() (#118223...
authorErlend E. Aasland <erlend@python.org>
Thu, 25 Apr 2024 08:33:35 +0000 (10:33 +0200)
committerGitHub <noreply@github.com>
Thu, 25 Apr 2024 08:33:35 +0000 (08:33 +0000)
commit7a843e8390f284fb6aa7c6fdebf88052a5b0be46
tree464f7ab4688e1b8d4e88c18959c65290098e2efd
parentfc1732ce3f26af5d082adac03ee73ef4814a5feb
[3.12] gh-118221: Always use the default row factory in sqlite3.iterdump() (#118223) (#118270)

sqlite3.iterdump() depends on the row factory returning resulting rows
as tuples; it will fail with custom row factories like for example a
dict factory.

With this commit, we explicitly reset the row factory of the cursor used
by iterdump(), so we always get predictable results. This does not
affect the row factory of the parent connection.

Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Lib/sqlite3/dump.py
Lib/test/test_sqlite3/test_dump.py
Misc/NEWS.d/next/Library/2024-04-24-12-29-33.gh-issue-118221.2k_bac.rst [new file with mode: 0644]