gh-118221: Always use the default row factory in sqlite3.iterdump()#118223
Merged
erlend-aasland merged 3 commits intopython:mainfrom Apr 25, 2024
Merged
Conversation
…mp() The iterdump() implementation depends on the row factory returning resulting rows as tuples; it will fail with custom row factories like for example a dict factory. Fixed by overriding the row factory of the cursor used by iterdump(). FTR, this does not affect the row factory of the parent connection.
Contributor
Author
|
@kesry, can you see if this patch works for you? |
Contributor
Author
|
cc. @felixxm who has poked around in the |
erlend-aasland
commented
Apr 24, 2024
Misc/NEWS.d/next/Library/2024-04-24-12-29-33.gh-issue-118221.2k_bac.rst
Outdated
Show resolved
Hide resolved
felixxm
reviewed
Apr 24, 2024
Contributor
felixxm
left a comment
There was a problem hiding this comment.
@erlend-aasland Thanks 👍
Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
Contributor
Author
|
Thanks for the review, Mariusz! I'll land this later this week, in case anyone else wants to take a look. |
serhiy-storchaka
approved these changes
Apr 24, 2024
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
That's good, thanks! |
Contributor
Author
|
Thanks for the review, Serhiy! |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
|
GH-118270 is a backport of this pull request to the 3.12 branch. |
erlend-aasland
added a commit
that referenced
this pull request
Apr 25, 2024
…ump() (#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>
This comment was marked as off-topic.
This comment was marked as off-topic.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The iterdump() implementation depends on the row factory returning
resulting rows as tuples; it will fail with custom row factories like
for example a dict factory.
Fixed by overriding the row factory of the cursor used by iterdump().
FTR, this does not affect the row factory of the parent connection.