Skip to content

deleting sqlite3 row_factory causes segfault #149738

@lunixbochs

Description

@lunixbochs

Crash report

What happened?

import sqlite3
db = sqlite3.connect(":memory:")
del db.row_factory
db.execute("test")

-> zsh: segmentation fault python3

In connection.c, the row_factory is compared against Py_None and incref'd, but deleting it sets it to null, resulting in Py_INCREF(NULL)

CPython versions tested on:

3.14

Operating systems tested on:

macOS

Output from running 'python -VV' on the command line:

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    extension-modulesC modules in the Modules dirtopic-sqlite3type-crashA hard crash of the interpreter, possibly with a core dump

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions