Skip to content

sqlite3: Raise ProgrammingError when operating on a closed cursor #6336

@ever0de

Description

@ever0de

Currently, the sqlite3 module does not strictly enforce checks when methods are called on a closed cursor.

Expected Behavior
To match CPython's behavior, calling methods like execute, executemany, executescript, or fetch methods (fetchone, fetchall, etc.) on a cursor after calling cursor.close() should raise a sqlite3.ProgrammingError.

Context
This issue is necessary to pass standard library tests that verify cursor state management. We need to ensure that any operation attempted on a closed cursor instance immediately raises the appropriate error.

test: ClosedCurTests::test_closed

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions