◐ Shell
clean mode source ↗

sqlite3: Raise ProgrammingError when operating on a closed cursor

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