Currently, the sqlite3 module does not correctly handle cases where a Blob object is accessed after its parent database connection has been closed.
Expected Behavior
To match CPython's behavior, attempting to read (or perform other operations) on a blob after calling connection.close() should raise a sqlite3.ProgrammingError with the message "Cannot operate on a closed database".
Context
This issue prevents the standard library test test_blob_closed_db_read from passing. We need to add a check to ensure the connection is still open before processing blob operations.
Currently, the
sqlite3module does not correctly handle cases where aBlobobject is accessed after its parent database connection has been closed.Expected Behavior
To match CPython's behavior, attempting to
read(or perform other operations) on a blob after callingconnection.close()should raise asqlite3.ProgrammingErrorwith the message "Cannot operate on a closed database".Context
This issue prevents the standard library test
test_blob_closed_db_readfrom passing. We need to add a check to ensure the connection is still open before processing blob operations.