Skip to content

sqlite: Raise ProgrammingError when operating on a blob with a closed connection #6285

Closed

Description

@ever0de

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.

Activity

  1. added a commit that references this issue on Nov 21, 2025
    edc9f29
  2. added a commit that references this issue on Nov 22, 2025
    567fb4d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions