[3.13] gh-142787: Handle empty sqlite3 blob slices (GH-142824) (#145298)

(cherry picked from commit 06b0920f12)

Co-authored-by: A.Ibrahim <abdulrasheedibrahim47@gmail.com>
This commit is contained in:
Miss Islington (bot) 2026-02-27 01:13:08 +01:00 committed by GitHub
parent 083477fbd6
commit cd3e9b3fd2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 11 additions and 0 deletions

View file

@ -428,6 +428,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);
}