https://github.com/python/cpython/commit/79937e3cf12ca9700da28389dd357014e9ae6a3b
commit: 79937e3cf12ca9700da28389dd357014e9ae6a3b
branch: 3.15
author: Miss Islington (bot) <[email protected]>
committer: serhiy-storchaka <[email protected]>
date: 2026-05-24T13:43:38Z
summary:

[3.15] gh-150285: Fix too long docstrings in the sqlite3 module (GH-150290) 
(GH-150340)

(cherry picked from commit 0466560b310fa74c38270328d66d6a16df95ec34)

Co-authored-by: Serhiy Storchaka <[email protected]>

files:
M Modules/_sqlite/blob.c
M Modules/_sqlite/clinic/blob.c.h
M Modules/_sqlite/clinic/connection.c.h
M Modules/_sqlite/connection.c

diff --git a/Modules/_sqlite/blob.c b/Modules/_sqlite/blob.c
index 8dad94556236bd6..2cc62751054278f 100644
--- a/Modules/_sqlite/blob.c
+++ b/Modules/_sqlite/blob.c
@@ -166,7 +166,6 @@ read_multiple(pysqlite_Blob *self, Py_ssize_t length, 
Py_ssize_t offset)
 
 
 /*[clinic input]
-@permit_long_docstring_body
 _sqlite3.Blob.read as blob_read
 
     length: int = -1
@@ -175,14 +174,14 @@ _sqlite3.Blob.read as blob_read
 
 Read data at the current offset position.
 
-If the end of the blob is reached, the data up to end of file will be returned.
-When length is not specified, or is negative, Blob.read() will read until the
-end of the blob.
+If the end of the blob is reached, the data up to end of file will
+be returned.  When length is not specified, or is negative,
+Blob.read() will read until the end of the blob.
 [clinic start generated code]*/
 
 static PyObject *
 blob_read_impl(pysqlite_Blob *self, int length)
-/*[clinic end generated code: output=1fc99b2541360dde input=e5715bcddbcfca5a]*/
+/*[clinic end generated code: output=1fc99b2541360dde input=6b745ad37720e556]*/
 {
     if (!check_blob(self)) {
         return NULL;
@@ -235,7 +234,6 @@ inner_write(pysqlite_Blob *self, const void *buf, 
Py_ssize_t len,
 
 
 /*[clinic input]
-@permit_long_docstring_body
 _sqlite3.Blob.write as blob_write
 
     data: Py_buffer
@@ -243,13 +241,13 @@ _sqlite3.Blob.write as blob_write
 
 Write data at the current offset.
 
-This function cannot change the blob length.  Writing beyond the end of the
-blob will result in an exception being raised.
+This function cannot change the blob length.  Writing beyond the end
+of the blob will result in an exception being raised.
 [clinic start generated code]*/
 
 static PyObject *
 blob_write_impl(pysqlite_Blob *self, Py_buffer *data)
-/*[clinic end generated code: output=b34cf22601b570b2 input=203d3458f244814b]*/
+/*[clinic end generated code: output=b34cf22601b570b2 input=0d372cb0240a5d49]*/
 {
     if (!check_blob(self)) {
         return NULL;
@@ -265,7 +263,6 @@ blob_write_impl(pysqlite_Blob *self, Py_buffer *data)
 
 
 /*[clinic input]
-@permit_long_docstring_body
 _sqlite3.Blob.seek as blob_seek
 
     offset: int
@@ -274,14 +271,15 @@ _sqlite3.Blob.seek as blob_seek
 
 Set the current access position to offset.
 
-The origin argument defaults to os.SEEK_SET (absolute blob positioning).
-Other values for origin are os.SEEK_CUR (seek relative to the current position)
-and os.SEEK_END (seek relative to the blob's end).
+The origin argument defaults to os.SEEK_SET (absolute blob
+positioning).  Other values for origin are os.SEEK_CUR (seek
+relative to the current position) and os.SEEK_END (seek relative to
+the blob's end).
 [clinic start generated code]*/
 
 static PyObject *
 blob_seek_impl(pysqlite_Blob *self, int offset, int origin)
-/*[clinic end generated code: output=854c5a0e208547a5 input=ee4d88e1dc0b1048]*/
+/*[clinic end generated code: output=854c5a0e208547a5 input=84aea1b6b48607dd]*/
 {
     if (!check_blob(self)) {
         return NULL;
diff --git a/Modules/_sqlite/clinic/blob.c.h b/Modules/_sqlite/clinic/blob.c.h
index 921e7cbd7ffcaba..929703257f04bee 100644
--- a/Modules/_sqlite/clinic/blob.c.h
+++ b/Modules/_sqlite/clinic/blob.c.h
@@ -31,9 +31,9 @@ PyDoc_STRVAR(blob_read__doc__,
 "  length\n"
 "    Read length in bytes.\n"
 "\n"
-"If the end of the blob is reached, the data up to end of file will be 
returned.\n"
-"When length is not specified, or is negative, Blob.read() will read until 
the\n"
-"end of the blob.");
+"If the end of the blob is reached, the data up to end of file will\n"
+"be returned.  When length is not specified, or is negative,\n"
+"Blob.read() will read until the end of the blob.");
 
 #define BLOB_READ_METHODDEF    \
     {"read", _PyCFunction_CAST(blob_read), METH_FASTCALL, blob_read__doc__},
@@ -70,8 +70,8 @@ PyDoc_STRVAR(blob_write__doc__,
 "\n"
 "Write data at the current offset.\n"
 "\n"
-"This function cannot change the blob length.  Writing beyond the end of the\n"
-"blob will result in an exception being raised.");
+"This function cannot change the blob length.  Writing beyond the end\n"
+"of the blob will result in an exception being raised.");
 
 #define BLOB_WRITE_METHODDEF    \
     {"write", (PyCFunction)blob_write, METH_O, blob_write__doc__},
@@ -105,9 +105,10 @@ PyDoc_STRVAR(blob_seek__doc__,
 "\n"
 "Set the current access position to offset.\n"
 "\n"
-"The origin argument defaults to os.SEEK_SET (absolute blob positioning).\n"
-"Other values for origin are os.SEEK_CUR (seek relative to the current 
position)\n"
-"and os.SEEK_END (seek relative to the blob\'s end).");
+"The origin argument defaults to os.SEEK_SET (absolute blob\n"
+"positioning).  Other values for origin are os.SEEK_CUR (seek\n"
+"relative to the current position) and os.SEEK_END (seek relative to\n"
+"the blob\'s end).");
 
 #define BLOB_SEEK_METHODDEF    \
     {"seek", _PyCFunction_CAST(blob_seek), METH_FASTCALL, blob_seek__doc__},
@@ -211,4 +212,4 @@ blob_exit(PyObject *self, PyObject *const *args, Py_ssize_t 
nargs)
 exit:
     return return_value;
 }
-/*[clinic end generated code: output=f03f4ba622b67ae0 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=b0e3d38063739b17 input=a9049054013a1b77]*/
diff --git a/Modules/_sqlite/clinic/connection.c.h 
b/Modules/_sqlite/clinic/connection.c.h
index abb864eb0307578..b645bf3464bcea1 100644
--- a/Modules/_sqlite/clinic/connection.c.h
+++ b/Modules/_sqlite/clinic/connection.c.h
@@ -685,13 +685,14 @@ 
PyDoc_STRVAR(pysqlite_connection_set_progress_handler__doc__,
 "\n"
 "  progress_handler\n"
 "    A callable that takes no arguments.\n"
-"    If the callable returns non-zero, the current query is terminated,\n"
-"    and an exception is raised.\n"
+"    If the callable returns non-zero, the current query is\n"
+"    terminated, and an exception is raised.\n"
 "  n\n"
 "    The number of SQLite virtual machine instructions that are\n"
 "    executed between invocations of \'progress_handler\'.\n"
 "\n"
-"If \'progress_handler\' is None or \'n\' is 0, the progress handler is 
disabled.");
+"If \'progress_handler\' is None or \'n\' is 0, the progress handler is\n"
+"disabled.");
 
 #define PYSQLITE_CONNECTION_SET_PROGRESS_HANDLER_METHODDEF    \
     {"set_progress_handler", 
_PyCFunction_CAST(pysqlite_connection_set_progress_handler), 
METH_METHOD|METH_FASTCALL|METH_KEYWORDS, 
pysqlite_connection_set_progress_handler__doc__},
@@ -1303,10 +1304,10 @@ PyDoc_STRVAR(serialize__doc__,
 "  name\n"
 "    Which database to serialize.\n"
 "\n"
-"For an ordinary on-disk database file, the serialization is just a copy of 
the\n"
-"disk file. For an in-memory database or a \"temp\" database, the 
serialization is\n"
-"the same sequence of bytes which would be written to disk if that database\n"
-"were backed up to disk.");
+"For an ordinary on-disk database file, the serialization is just\n"
+"a copy of the disk file.  For an in-memory database or a \"temp\"\n"
+"database, the serialization is the same sequence of bytes which\n"
+"would be written to disk if that database were backed up to disk.");
 
 #define SERIALIZE_METHODDEF    \
     {"serialize", _PyCFunction_CAST(serialize), METH_FASTCALL|METH_KEYWORDS, 
serialize__doc__},
@@ -1392,12 +1393,13 @@ PyDoc_STRVAR(deserialize__doc__,
 "  name\n"
 "    Which database to reopen with the deserialization.\n"
 "\n"
-"The deserialize interface causes the database connection to disconnect from 
the\n"
-"target database, and then reopen it as an in-memory database based on the 
given\n"
-"serialized data.\n"
+"The deserialize interface causes the database connection to\n"
+"disconnect from the target database, and then reopen it as\n"
+"an in-memory database based on the given serialized data.\n"
 "\n"
-"The deserialize interface will fail with SQLITE_BUSY if the database is\n"
-"currently in a read transaction or is involved in a backup operation.");
+"The deserialize interface will fail with SQLITE_BUSY if the database\n"
+"is currently in a read transaction or is involved in a backup\n"
+"operation.");
 
 #define DESERIALIZE_METHODDEF    \
     {"deserialize", _PyCFunction_CAST(deserialize), 
METH_FASTCALL|METH_KEYWORDS, deserialize__doc__},
@@ -1518,7 +1520,8 @@ PyDoc_STRVAR(pysqlite_connection_exit__doc__,
 "\n"
 "Called when the connection is used as a context manager.\n"
 "\n"
-"If there was any exception, a rollback takes place; otherwise we commit.");
+"If there was any exception, a rollback takes place; otherwise we\n"
+"commit.");
 
 #define PYSQLITE_CONNECTION_EXIT_METHODDEF    \
     {"__exit__", _PyCFunction_CAST(pysqlite_connection_exit), METH_FASTCALL, 
pysqlite_connection_exit__doc__},
@@ -1556,12 +1559,12 @@ PyDoc_STRVAR(setlimit__doc__,
 "  category\n"
 "    The limit category to be set.\n"
 "  limit\n"
-"    The new limit. If the new limit is a negative number, the limit is\n"
-"    unchanged.\n"
+"    The new limit. If the new limit is a negative number, the limit\n"
+"    is unchanged.\n"
 "\n"
-"Attempts to increase a limit above its hard upper bound are silently 
truncated\n"
-"to the hard upper bound. Regardless of whether or not the limit was 
changed,\n"
-"the prior value of the limit is returned.");
+"Attempts to increase a limit above its hard upper bound are silently\n"
+"truncated to the hard upper bound. Regardless of whether or not the\n"
+"limit was changed, the prior value of the limit is returned.");
 
 #define SETLIMIT_METHODDEF    \
     {"setlimit", _PyCFunction_CAST(setlimit), METH_FASTCALL, setlimit__doc__},
@@ -1722,4 +1725,4 @@ getconfig(PyObject *self, PyObject *arg)
 #ifndef DESERIALIZE_METHODDEF
     #define DESERIALIZE_METHODDEF
 #endif /* !defined(DESERIALIZE_METHODDEF) */
-/*[clinic end generated code: output=16d44c1d8a45e622 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=1418b72751ef68fc input=a9049054013a1b77]*/
diff --git a/Modules/_sqlite/connection.c b/Modules/_sqlite/connection.c
index bd44ff31b87c67b..f596cc1ab36a19c 100644
--- a/Modules/_sqlite/connection.c
+++ b/Modules/_sqlite/connection.c
@@ -1561,14 +1561,13 @@ 
pysqlite_connection_set_authorizer_impl(pysqlite_Connection *self,
 }
 
 /*[clinic input]
-@permit_long_docstring_body
 _sqlite3.Connection.set_progress_handler as 
pysqlite_connection_set_progress_handler
 
     cls: defining_class
     progress_handler as callable: object
         A callable that takes no arguments.
-        If the callable returns non-zero, the current query is terminated,
-        and an exception is raised.
+        If the callable returns non-zero, the current query is
+        terminated, and an exception is raised.
     /
     n: int
         The number of SQLite virtual machine instructions that are
@@ -1576,14 +1575,15 @@ _sqlite3.Connection.set_progress_handler as 
pysqlite_connection_set_progress_han
 
 Set progress handler callback.
 
-If 'progress_handler' is None or 'n' is 0, the progress handler is disabled.
+If 'progress_handler' is None or 'n' is 0, the progress handler is
+disabled.
 [clinic start generated code]*/
 
 static PyObject *
 pysqlite_connection_set_progress_handler_impl(pysqlite_Connection *self,
                                               PyTypeObject *cls,
                                               PyObject *callable, int n)
-/*[clinic end generated code: output=0739957fd8034a50 input=3ecce6c915922ad4]*/
+/*[clinic end generated code: output=0739957fd8034a50 input=fd0d5abb004f370f]*/
 {
     if (!pysqlite_check_thread(self) || !pysqlite_check_connection(self)) {
         return NULL;
@@ -1606,6 +1606,7 @@ 
pysqlite_connection_set_progress_handler_impl(pysqlite_Connection *self,
 }
 
 /*[clinic input]
+@permit_long_summary
 _sqlite3.Connection.set_trace_callback as 
pysqlite_connection_set_trace_callback
 
     cls: defining_class
@@ -1619,7 +1620,7 @@ static PyObject *
 pysqlite_connection_set_trace_callback_impl(pysqlite_Connection *self,
                                             PyTypeObject *cls,
                                             PyObject *callable)
-/*[clinic end generated code: output=d91048c03bfcee05 input=f4f59bf2f87f2026]*/
+/*[clinic end generated code: output=d91048c03bfcee05 input=edfd7d890200a9cb]*/
 {
     if (!pysqlite_check_thread(self) || !pysqlite_check_connection(self)) {
         return NULL;
@@ -2212,7 +2213,6 @@ 
pysqlite_connection_create_collation_impl(pysqlite_Connection *self,
 
 #ifdef PY_SQLITE_HAVE_SERIALIZE
 /*[clinic input]
-@permit_long_docstring_body
 _sqlite3.Connection.serialize as serialize
 
     *
@@ -2221,15 +2221,15 @@ _sqlite3.Connection.serialize as serialize
 
 Serialize a database into a byte string.
 
-For an ordinary on-disk database file, the serialization is just a copy of the
-disk file. For an in-memory database or a "temp" database, the serialization is
-the same sequence of bytes which would be written to disk if that database
-were backed up to disk.
+For an ordinary on-disk database file, the serialization is just
+a copy of the disk file.  For an in-memory database or a "temp"
+database, the serialization is the same sequence of bytes which
+would be written to disk if that database were backed up to disk.
 [clinic start generated code]*/
 
 static PyObject *
 serialize_impl(pysqlite_Connection *self, const char *name)
-/*[clinic end generated code: output=97342b0e55239dd3 input=963e617cdf75c747]*/
+/*[clinic end generated code: output=97342b0e55239dd3 input=7e48654e8e082fa8]*/
 {
     if (!pysqlite_check_thread(self) || !pysqlite_check_connection(self)) {
         return NULL;
@@ -2263,7 +2263,6 @@ serialize_impl(pysqlite_Connection *self, const char 
*name)
 }
 
 /*[clinic input]
-@permit_long_docstring_body
 _sqlite3.Connection.deserialize as deserialize
 
     data: Py_buffer(accept={buffer, str})
@@ -2275,18 +2274,19 @@ _sqlite3.Connection.deserialize as deserialize
 
 Load a serialized database.
 
-The deserialize interface causes the database connection to disconnect from the
-target database, and then reopen it as an in-memory database based on the given
-serialized data.
+The deserialize interface causes the database connection to
+disconnect from the target database, and then reopen it as
+an in-memory database based on the given serialized data.
 
-The deserialize interface will fail with SQLITE_BUSY if the database is
-currently in a read transaction or is involved in a backup operation.
+The deserialize interface will fail with SQLITE_BUSY if the database
+is currently in a read transaction or is involved in a backup
+operation.
 [clinic start generated code]*/
 
 static PyObject *
 deserialize_impl(pysqlite_Connection *self, Py_buffer *data,
                  const char *name)
-/*[clinic end generated code: output=e394c798b98bad89 input=037e94599aaa5b5c]*/
+/*[clinic end generated code: output=e394c798b98bad89 input=5d20e028d98c0686]*/
 {
     if (!pysqlite_check_thread(self) || !pysqlite_check_connection(self)) {
         return NULL;
@@ -2359,13 +2359,14 @@ _sqlite3.Connection.__exit__ as pysqlite_connection_exit
 
 Called when the connection is used as a context manager.
 
-If there was any exception, a rollback takes place; otherwise we commit.
+If there was any exception, a rollback takes place; otherwise we
+commit.
 [clinic start generated code]*/
 
 static PyObject *
 pysqlite_connection_exit_impl(pysqlite_Connection *self, PyObject *exc_type,
                               PyObject *exc_value, PyObject *exc_tb)
-/*[clinic end generated code: output=0705200e9321202a input=bd66f1532c9c54a7]*/
+/*[clinic end generated code: output=0705200e9321202a input=8fdb0392ee6f3466]*/
 {
     int commit = 0;
     PyObject* result;
@@ -2400,26 +2401,25 @@ pysqlite_connection_exit_impl(pysqlite_Connection 
*self, PyObject *exc_type,
 }
 
 /*[clinic input]
-@permit_long_docstring_body
 _sqlite3.Connection.setlimit as setlimit
 
     category: int
         The limit category to be set.
     limit: int
-        The new limit. If the new limit is a negative number, the limit is
-        unchanged.
+        The new limit. If the new limit is a negative number, the limit
+        is unchanged.
     /
 
 Set connection run-time limits.
 
-Attempts to increase a limit above its hard upper bound are silently truncated
-to the hard upper bound. Regardless of whether or not the limit was changed,
-the prior value of the limit is returned.
+Attempts to increase a limit above its hard upper bound are silently
+truncated to the hard upper bound. Regardless of whether or not the
+limit was changed, the prior value of the limit is returned.
 [clinic start generated code]*/
 
 static PyObject *
 setlimit_impl(pysqlite_Connection *self, int category, int limit)
-/*[clinic end generated code: output=0d208213f8d68ccd input=bf06e06a21eb37e2]*/
+/*[clinic end generated code: output=0d208213f8d68ccd input=5c2e430091206677]*/
 {
     if (!pysqlite_check_thread(self) || !pysqlite_check_connection(self)) {
         return NULL;

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to