Skip to content

gh-152817: Prevent deletion of sqlite3 cursor.row_factory attr, missed from: gh-149738#152818

Open
stestagg wants to merge 3 commits into
python:mainfrom
stestagg:main
Open

gh-152817: Prevent deletion of sqlite3 cursor.row_factory attr, missed from: gh-149738#152818
stestagg wants to merge 3 commits into
python:mainfrom
stestagg:main

Conversation

@stestagg

@stestagg stestagg commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

gh-149738 prevents deletion of row_factory and text_factory attributes on a sqlite3 connection, this PR applies that fix to cursor objects too, to avoid a similar segfault:

import sqlite3

cur = sqlite3.connect(":memory:").cursor()
del cur.row_factory
cur.execute("select 1").fetchone()

I've piggy-backed off the existing docs change and blurb as that seems to cover this already

@stestagg

stestagg commented Jul 1, 2026

Copy link
Copy Markdown
Contributor Author

@sepehr-rs - You were the author of the original, are you able to take a look? Thanks in advance!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant