From b1f36411177b8d0300f44b70d1c900bb2aa3b855 Mon Sep 17 00:00:00 2001 From: chiri Date: Wed, 10 Sep 2025 12:44:44 +0300 Subject: [PATCH 1/6] fix `row` type --- Doc/library/sqlite3.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/library/sqlite3.rst b/Doc/library/sqlite3.rst index d317ead66f9bcb..0bd6eebc6f0c9b 100644 --- a/Doc/library/sqlite3.rst +++ b/Doc/library/sqlite3.rst @@ -631,7 +631,7 @@ Connection objects :param str column: The name of the column where the blob is located. - :param str row: + :param int row: The name of the row where the blob is located. :param bool readonly: From 1b44fac16890937a07c5754d2a358298446e3181 Mon Sep 17 00:00:00 2001 From: chiri Date: Wed, 10 Sep 2025 12:57:37 +0300 Subject: [PATCH 2/6] correct the `row` description --- Doc/library/sqlite3.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/library/sqlite3.rst b/Doc/library/sqlite3.rst index 0bd6eebc6f0c9b..641a6ed58c4425 100644 --- a/Doc/library/sqlite3.rst +++ b/Doc/library/sqlite3.rst @@ -632,7 +632,7 @@ Connection objects The name of the column where the blob is located. :param int row: - The name of the row where the blob is located. + Row id of the row that contains the blob. :param bool readonly: Set to ``True`` if the blob should be opened without write From b973841281f73acf2bbded56ad0c3f3a08066e04 Mon Sep 17 00:00:00 2001 From: chiri Date: Wed, 10 Sep 2025 14:26:15 +0300 Subject: [PATCH 3/6] update description --- Doc/library/sqlite3.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/library/sqlite3.rst b/Doc/library/sqlite3.rst index 641a6ed58c4425..23ae2bb8ecfd3d 100644 --- a/Doc/library/sqlite3.rst +++ b/Doc/library/sqlite3.rst @@ -632,7 +632,7 @@ Connection objects The name of the column where the blob is located. :param int row: - Row id of the row that contains the blob. + The index of the row where the blob is located. :param bool readonly: Set to ``True`` if the blob should be opened without write From 74fbf670a13ed9db93f20778f3fcdd85971622ae Mon Sep 17 00:00:00 2001 From: chiri Date: Wed, 17 Sep 2025 18:08:15 +0300 Subject: [PATCH 4/6] rename to `rowid` --- Doc/library/sqlite3.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Doc/library/sqlite3.rst b/Doc/library/sqlite3.rst index 23ae2bb8ecfd3d..9214f210eb92f1 100644 --- a/Doc/library/sqlite3.rst +++ b/Doc/library/sqlite3.rst @@ -631,8 +631,8 @@ Connection objects :param str column: The name of the column where the blob is located. - :param int row: - The index of the row where the blob is located. + :param int rowid: + The rowid of the row where the blob is located. :param bool readonly: Set to ``True`` if the blob should be opened without write From 604027d2c79f7f582d6d315d99299acbe08c165d Mon Sep 17 00:00:00 2001 From: "Erlend E. Aasland" Date: Wed, 17 Sep 2025 16:04:54 +0100 Subject: [PATCH 5/6] Suggestions --- Doc/library/sqlite3.rst | 6 +++--- Modules/_sqlite/connection.c | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Doc/library/sqlite3.rst b/Doc/library/sqlite3.rst index 23ae2bb8ecfd3d..6a7e15db223210 100644 --- a/Doc/library/sqlite3.rst +++ b/Doc/library/sqlite3.rst @@ -620,7 +620,7 @@ Connection objects supplied, this must be a :term:`callable` returning an instance of :class:`Cursor` or its subclasses. - .. method:: blobopen(table, column, row, /, *, readonly=False, name="main") + .. method:: blobopen(table, column, rowid, /, *, readonly=False, name="main") Open a :class:`Blob` handle to an existing :abbr:`BLOB (Binary Large OBject)`. @@ -631,8 +631,8 @@ Connection objects :param str column: The name of the column where the blob is located. - :param int row: - The index of the row where the blob is located. + :param int rowid: + The row id where the blob is located. :param bool readonly: Set to ``True`` if the blob should be opened without write diff --git a/Modules/_sqlite/connection.c b/Modules/_sqlite/connection.c index 208e3c18425986..74aaa7ad2d28e0 100644 --- a/Modules/_sqlite/connection.c +++ b/Modules/_sqlite/connection.c @@ -578,8 +578,8 @@ _sqlite3.Connection.blobopen as blobopen Table name. column as col: str Column name. - row: sqlite3_int64 - Row index. + rowid: sqlite3_int64 + Row id. / * readonly: bool = False @@ -592,7 +592,7 @@ Open and return a BLOB object. static PyObject * blobopen_impl(pysqlite_Connection *self, const char *table, const char *col, - sqlite3_int64 row, int readonly, const char *name) + sqlite3_int64 rowid, int readonly, const char *name) /*[clinic end generated code: output=6a02d43efb885d1c input=23576bd1108d8774]*/ { if (!pysqlite_check_thread(self) || !pysqlite_check_connection(self)) { @@ -603,7 +603,7 @@ blobopen_impl(pysqlite_Connection *self, const char *table, const char *col, sqlite3_blob *blob; Py_BEGIN_ALLOW_THREADS - rc = sqlite3_blob_open(self->db, name, table, col, row, !readonly, &blob); + rc = sqlite3_blob_open(self->db, name, table, col, rowid, !readonly, &blob); Py_END_ALLOW_THREADS if (rc == SQLITE_MISUSE) { From cfc8aed4b15dbd44f1b61210bcd3a0cf5301d828 Mon Sep 17 00:00:00 2001 From: "Erlend E. Aasland" Date: Wed, 17 Sep 2025 16:22:20 +0100 Subject: [PATCH 6/6] Fix clinic --- Modules/_sqlite/clinic/connection.c.h | 8 ++++---- Modules/_sqlite/connection.c | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Modules/_sqlite/clinic/connection.c.h b/Modules/_sqlite/clinic/connection.c.h index f0e9fdb889413f..abb864eb030757 100644 --- a/Modules/_sqlite/clinic/connection.c.h +++ b/Modules/_sqlite/clinic/connection.c.h @@ -209,7 +209,7 @@ pysqlite_connection_cursor(PyObject *self, PyObject *const *args, Py_ssize_t nar } PyDoc_STRVAR(blobopen__doc__, -"blobopen($self, table, column, row, /, *, readonly=False, name=\'main\')\n" +"blobopen($self, table, column, rowid, /, *, readonly=False, name=\'main\')\n" "--\n" "\n" "Open and return a BLOB object.\n" @@ -218,8 +218,8 @@ PyDoc_STRVAR(blobopen__doc__, " Table name.\n" " column\n" " Column name.\n" -" row\n" -" Row index.\n" +" rowid\n" +" Row id.\n" " readonly\n" " Open the BLOB without write permissions.\n" " name\n" @@ -1722,4 +1722,4 @@ getconfig(PyObject *self, PyObject *arg) #ifndef DESERIALIZE_METHODDEF #define DESERIALIZE_METHODDEF #endif /* !defined(DESERIALIZE_METHODDEF) */ -/*[clinic end generated code: output=6cb96e557133d553 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=16d44c1d8a45e622 input=a9049054013a1b77]*/ diff --git a/Modules/_sqlite/connection.c b/Modules/_sqlite/connection.c index 74aaa7ad2d28e0..9e6209315dd9c7 100644 --- a/Modules/_sqlite/connection.c +++ b/Modules/_sqlite/connection.c @@ -578,7 +578,7 @@ _sqlite3.Connection.blobopen as blobopen Table name. column as col: str Column name. - rowid: sqlite3_int64 + rowid as row: sqlite3_int64 Row id. / * @@ -592,8 +592,8 @@ Open and return a BLOB object. static PyObject * blobopen_impl(pysqlite_Connection *self, const char *table, const char *col, - sqlite3_int64 rowid, int readonly, const char *name) -/*[clinic end generated code: output=6a02d43efb885d1c input=23576bd1108d8774]*/ + sqlite3_int64 row, int readonly, const char *name) +/*[clinic end generated code: output=6a02d43efb885d1c input=cc3d4b47dac08401]*/ { if (!pysqlite_check_thread(self) || !pysqlite_check_connection(self)) { return NULL; @@ -603,7 +603,7 @@ blobopen_impl(pysqlite_Connection *self, const char *table, const char *col, sqlite3_blob *blob; Py_BEGIN_ALLOW_THREADS - rc = sqlite3_blob_open(self->db, name, table, col, rowid, !readonly, &blob); + rc = sqlite3_blob_open(self->db, name, table, col, row, !readonly, &blob); Py_END_ALLOW_THREADS if (rc == SQLITE_MISUSE) {