https://github.com/python/cpython/commit/b030936f3332caba70bab3004ec86c265fcf7e6c
commit: b030936f3332caba70bab3004ec86c265fcf7e6c
branch: 3.13
author: Serhiy Storchaka <[email protected]>
committer: serhiy-storchaka <[email protected]>
date: 2026-05-26T10:11:11Z
summary:

[3.13] gh-150285: Fix too long docstrings in the sqlite3 module (GH-150290) 
(GH-150461) (GH-150471)

(cherry picked from commit 7168b02795e5af4f59f9416a2e6a61a13fc45180)
(cherry picked from commit 0466560b310fa74c38270328d66d6a16df95ec34)

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 4db1ac474ef2531..396a360db7fe42d 100644
--- a/Modules/_sqlite/blob.c
+++ b/Modules/_sqlite/blob.c
@@ -167,14 +167,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=f2e4aa4378837250]*/
+/*[clinic end generated code: output=1fc99b2541360dde input=6b745ad37720e556]*/
 {
     if (!check_blob(self)) {
         return NULL;
@@ -234,13 +234,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=a84712f24a028e6d]*/
+/*[clinic end generated code: output=b34cf22601b570b2 input=0d372cb0240a5d49]*/
 {
     if (!check_blob(self)) {
         return NULL;
@@ -264,14 +264,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=5da9a07e55fe6bb6]*/
+/*[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 b95ba948aaf97f7..bfafcf05410a1bf 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(pysqlite_Blob *self, PyObject *const *args, 
Py_ssize_t nargs)
 exit:
     return return_value;
 }
-/*[clinic end generated code: output=31abd55660e0c5af input=a9049054013a1b77]*/
+/*[clinic end generated code: output=45168bcaeea61140 input=a9049054013a1b77]*/
diff --git a/Modules/_sqlite/clinic/connection.c.h 
b/Modules/_sqlite/clinic/connection.c.h
index c44b761aca67e93..4eede407f9af1d5 100644
--- a/Modules/_sqlite/clinic/connection.c.h
+++ b/Modules/_sqlite/clinic/connection.c.h
@@ -799,13 +799,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.\n"
+"If \'progress_handler\' is None or \'n\' is 0, the progress handler is\n"
+"disabled.\n"
 "\n"
 "Note: Passing keyword argument \'progress_handler\' to\n"
 "_sqlite3.Connection.set_progress_handler() is deprecated. Parameter\n"
@@ -1453,10 +1454,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__},
@@ -1539,12 +1540,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__},
@@ -1662,7 +1664,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__},
@@ -1700,12 +1703,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__},
@@ -1866,4 +1869,4 @@ getconfig(pysqlite_Connection *self, PyObject *arg)
 #ifndef DESERIALIZE_METHODDEF
     #define DESERIALIZE_METHODDEF
 #endif /* !defined(DESERIALIZE_METHODDEF) */
-/*[clinic end generated code: output=fa34f4c5f8837a7c input=a9049054013a1b77]*/
+/*[clinic end generated code: output=5e0bcef289eb64cc input=a9049054013a1b77]*/
diff --git a/Modules/_sqlite/connection.c b/Modules/_sqlite/connection.c
index 5f888ac19ec24d6..a45de0fcca47f75 100644
--- a/Modules/_sqlite/connection.c
+++ b/Modules/_sqlite/connection.c
@@ -1590,8 +1590,8 @@ _sqlite3.Connection.set_progress_handler as 
pysqlite_connection_set_progress_han
     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.
     / [from 3.15]
     n: int
         The number of SQLite virtual machine instructions that are
@@ -1599,14 +1599,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=b4d6e2ef8b4d32f9]*/
+/*[clinic end generated code: output=0739957fd8034a50 input=d46887797f0c0ecf]*/
 {
     if (!pysqlite_check_thread(self) || !pysqlite_check_connection(self)) {
         return NULL;
@@ -2234,15 +2235,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=d2eb5194a65abe2b]*/
+/*[clinic end generated code: output=97342b0e55239dd3 input=7e48654e8e082fa8]*/
 {
     if (!pysqlite_check_thread(self) || !pysqlite_check_connection(self)) {
         return NULL;
@@ -2287,18 +2288,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=1be4ca1faacf28f2]*/
+/*[clinic end generated code: output=e394c798b98bad89 input=5d20e028d98c0686]*/
 {
     if (!pysqlite_check_thread(self) || !pysqlite_check_connection(self)) {
         return NULL;
@@ -2371,13 +2373,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;
@@ -2417,20 +2420,20 @@ _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=9bd469537e195635]*/
+/*[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