gh-152817: Prevent deletion of sqlite3 cursor.row_factory attr, missed from: gh-149738#152818
gh-152817: Prevent deletion of sqlite3 cursor.row_factory attr, missed from: gh-149738#152818stestagg wants to merge 3 commits into
cursor.row_factory attr, missed from: gh-149738#152818Conversation
prevent segfault and bring behaviour in line with docs
|
@sepehr-rs - You were the author of the original, are you able to take a look? Thanks in advance! |
sepehr-rs
left a comment
There was a problem hiding this comment.
Hi @stestagg, thank you for reaching out to me on this!
I think your change is good, but I believe you should also add a versionchanged:: next note under the Cursor.row_factory attribute docs, mirroring what was added for Connection.row_factory/text_factory. Besides that, +1 from me.
As I understand it, gh-149738 already altered the doc for the cpython/Doc/library/sqlite3.rst Lines 1718 to 1719 in f3bf8ab It's likely I've misunderstood/missed something here! |
Oh, you're right. I must have forgotten about that. This is a real gap, thanks for checking this! :) |
|
There's a related issue that I uncovered above, if you create a To me, there's a few options:
I'm not sure of the best approach tbh. |
gh-149738 prevents deletion of
row_factoryandtext_factoryattributes on a sqlite3 connection, this PR applies that fix tocursorobjects too, to avoid a similar segfault:I've piggy-backed off the existing docs change and blurb as that seems to cover this already
row_factoryattr of sqlite3cursor#152817