Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
:meth:`sqlite3.Connection.serialize` now raises :exc:`OverflowError` on 32-bit
platforms if the serialized database exceeds ``INT_MAX`` bytes.
5 changes: 4 additions & 1 deletion Modules/_sqlite/connection.c
Original file line number Diff line number Diff line change
Expand Up @@ -2091,7 +2091,10 @@ serialize_impl(pysqlite_Connection *self, const char *name)
name);
return NULL;
}
PyObject *res = PyBytes_FromStringAndSize(data, size);
#if PY_SSIZE_T_MAX < 9223372036854775807
size = Py_MIN(size, INT_MAX);
#endif
PyObject *res = PyBytes_FromStringAndSize(data, (Py_ssize_t)size);
if (!(flags & SQLITE_SERIALIZE_NOCOPY)) {
sqlite3_free((void *)data);
}
Expand Down