Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
gh-142787: Fix assertion failure in sqlite3 blob slice
  • Loading branch information
abdoulrasheed committed Dec 16, 2025
commit 97ca005b1d1eb360a796cb4bb238a57e96b2fc5d
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Fix assertion failure in :mod:`sqlite3` blob subscript when slicing with
indices that result in an empty slice.
4 changes: 4 additions & 0 deletions Modules/_sqlite/blob.c
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,10 @@ subscript_slice(pysqlite_Blob *self, PyObject *item)
return NULL;
}

if (len == 0) {
return PyBytes_FromStringAndSize(NULL, 0);
}

if (step == 1) {
return read_multiple(self, len, start);
}
Expand Down
Loading