Skip to content

Commit 7168b02

Browse files
[3.14] gh-150285: Fix too long docstrings in the sqlite3 module (GH-150290) (GH-150461)
(cherry picked from commit 0466560)
1 parent 9d79e71 commit 7168b02

4 files changed

Lines changed: 70 additions & 62 deletions

File tree

Modules/_sqlite/blob.c

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -172,14 +172,14 @@ _sqlite3.Blob.read as blob_read
172172
173173
Read data at the current offset position.
174174
175-
If the end of the blob is reached, the data up to end of file will be returned.
176-
When length is not specified, or is negative, Blob.read() will read until the
177-
end of the blob.
175+
If the end of the blob is reached, the data up to end of file will
176+
be returned. When length is not specified, or is negative,
177+
Blob.read() will read until the end of the blob.
178178
[clinic start generated code]*/
179179

180180
static PyObject *
181181
blob_read_impl(pysqlite_Blob *self, int length)
182-
/*[clinic end generated code: output=1fc99b2541360dde input=f2e4aa4378837250]*/
182+
/*[clinic end generated code: output=1fc99b2541360dde input=6b745ad37720e556]*/
183183
{
184184
if (!check_blob(self)) {
185185
return NULL;
@@ -239,13 +239,13 @@ _sqlite3.Blob.write as blob_write
239239
240240
Write data at the current offset.
241241
242-
This function cannot change the blob length. Writing beyond the end of the
243-
blob will result in an exception being raised.
242+
This function cannot change the blob length. Writing beyond the end
243+
of the blob will result in an exception being raised.
244244
[clinic start generated code]*/
245245

246246
static PyObject *
247247
blob_write_impl(pysqlite_Blob *self, Py_buffer *data)
248-
/*[clinic end generated code: output=b34cf22601b570b2 input=a84712f24a028e6d]*/
248+
/*[clinic end generated code: output=b34cf22601b570b2 input=0d372cb0240a5d49]*/
249249
{
250250
if (!check_blob(self)) {
251251
return NULL;
@@ -269,14 +269,15 @@ _sqlite3.Blob.seek as blob_seek
269269
270270
Set the current access position to offset.
271271
272-
The origin argument defaults to os.SEEK_SET (absolute blob positioning).
273-
Other values for origin are os.SEEK_CUR (seek relative to the current position)
274-
and os.SEEK_END (seek relative to the blob's end).
272+
The origin argument defaults to os.SEEK_SET (absolute blob
273+
positioning). Other values for origin are os.SEEK_CUR (seek
274+
relative to the current position) and os.SEEK_END (seek relative to
275+
the blob's end).
275276
[clinic start generated code]*/
276277

277278
static PyObject *
278279
blob_seek_impl(pysqlite_Blob *self, int offset, int origin)
279-
/*[clinic end generated code: output=854c5a0e208547a5 input=5da9a07e55fe6bb6]*/
280+
/*[clinic end generated code: output=854c5a0e208547a5 input=84aea1b6b48607dd]*/
280281
{
281282
if (!check_blob(self)) {
282283
return NULL;

Modules/_sqlite/clinic/blob.c.h

Lines changed: 10 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Modules/_sqlite/clinic/connection.c.h

Lines changed: 22 additions & 19 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Modules/_sqlite/connection.c

Lines changed: 26 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1619,23 +1619,24 @@ _sqlite3.Connection.set_progress_handler as pysqlite_connection_set_progress_han
16191619
cls: defining_class
16201620
progress_handler as callable: object
16211621
A callable that takes no arguments.
1622-
If the callable returns non-zero, the current query is terminated,
1623-
and an exception is raised.
1622+
If the callable returns non-zero, the current query is
1623+
terminated, and an exception is raised.
16241624
/ [from 3.15]
16251625
n: int
16261626
The number of SQLite virtual machine instructions that are
16271627
executed between invocations of 'progress_handler'.
16281628
16291629
Set progress handler callback.
16301630
1631-
If 'progress_handler' is None or 'n' is 0, the progress handler is disabled.
1631+
If 'progress_handler' is None or 'n' is 0, the progress handler is
1632+
disabled.
16321633
[clinic start generated code]*/
16331634

16341635
static PyObject *
16351636
pysqlite_connection_set_progress_handler_impl(pysqlite_Connection *self,
16361637
PyTypeObject *cls,
16371638
PyObject *callable, int n)
1638-
/*[clinic end generated code: output=0739957fd8034a50 input=b4d6e2ef8b4d32f9]*/
1639+
/*[clinic end generated code: output=0739957fd8034a50 input=d46887797f0c0ecf]*/
16391640
{
16401641
if (!pysqlite_check_thread(self) || !pysqlite_check_connection(self)) {
16411642
return NULL;
@@ -2272,15 +2273,15 @@ _sqlite3.Connection.serialize as serialize
22722273
22732274
Serialize a database into a byte string.
22742275
2275-
For an ordinary on-disk database file, the serialization is just a copy of the
2276-
disk file. For an in-memory database or a "temp" database, the serialization is
2277-
the same sequence of bytes which would be written to disk if that database
2278-
were backed up to disk.
2276+
For an ordinary on-disk database file, the serialization is just
2277+
a copy of the disk file. For an in-memory database or a "temp"
2278+
database, the serialization is the same sequence of bytes which
2279+
would be written to disk if that database were backed up to disk.
22792280
[clinic start generated code]*/
22802281

22812282
static PyObject *
22822283
serialize_impl(pysqlite_Connection *self, const char *name)
2283-
/*[clinic end generated code: output=97342b0e55239dd3 input=d2eb5194a65abe2b]*/
2284+
/*[clinic end generated code: output=97342b0e55239dd3 input=7e48654e8e082fa8]*/
22842285
{
22852286
if (!pysqlite_check_thread(self) || !pysqlite_check_connection(self)) {
22862287
return NULL;
@@ -2325,18 +2326,19 @@ _sqlite3.Connection.deserialize as deserialize
23252326
23262327
Load a serialized database.
23272328
2328-
The deserialize interface causes the database connection to disconnect from the
2329-
target database, and then reopen it as an in-memory database based on the given
2330-
serialized data.
2329+
The deserialize interface causes the database connection to
2330+
disconnect from the target database, and then reopen it as
2331+
an in-memory database based on the given serialized data.
23312332
2332-
The deserialize interface will fail with SQLITE_BUSY if the database is
2333-
currently in a read transaction or is involved in a backup operation.
2333+
The deserialize interface will fail with SQLITE_BUSY if the database
2334+
is currently in a read transaction or is involved in a backup
2335+
operation.
23342336
[clinic start generated code]*/
23352337

23362338
static PyObject *
23372339
deserialize_impl(pysqlite_Connection *self, Py_buffer *data,
23382340
const char *name)
2339-
/*[clinic end generated code: output=e394c798b98bad89 input=1be4ca1faacf28f2]*/
2341+
/*[clinic end generated code: output=e394c798b98bad89 input=5d20e028d98c0686]*/
23402342
{
23412343
if (!pysqlite_check_thread(self) || !pysqlite_check_connection(self)) {
23422344
return NULL;
@@ -2409,13 +2411,14 @@ _sqlite3.Connection.__exit__ as pysqlite_connection_exit
24092411
24102412
Called when the connection is used as a context manager.
24112413
2412-
If there was any exception, a rollback takes place; otherwise we commit.
2414+
If there was any exception, a rollback takes place; otherwise we
2415+
commit.
24132416
[clinic start generated code]*/
24142417

24152418
static PyObject *
24162419
pysqlite_connection_exit_impl(pysqlite_Connection *self, PyObject *exc_type,
24172420
PyObject *exc_value, PyObject *exc_tb)
2418-
/*[clinic end generated code: output=0705200e9321202a input=bd66f1532c9c54a7]*/
2421+
/*[clinic end generated code: output=0705200e9321202a input=8fdb0392ee6f3466]*/
24192422
{
24202423
int commit = 0;
24212424
PyObject* result;
@@ -2455,20 +2458,20 @@ _sqlite3.Connection.setlimit as setlimit
24552458
category: int
24562459
The limit category to be set.
24572460
limit: int
2458-
The new limit. If the new limit is a negative number, the limit is
2459-
unchanged.
2461+
The new limit. If the new limit is a negative number, the limit
2462+
is unchanged.
24602463
/
24612464
24622465
Set connection run-time limits.
24632466
2464-
Attempts to increase a limit above its hard upper bound are silently truncated
2465-
to the hard upper bound. Regardless of whether or not the limit was changed,
2466-
the prior value of the limit is returned.
2467+
Attempts to increase a limit above its hard upper bound are silently
2468+
truncated to the hard upper bound. Regardless of whether or not the
2469+
limit was changed, the prior value of the limit is returned.
24672470
[clinic start generated code]*/
24682471

24692472
static PyObject *
24702473
setlimit_impl(pysqlite_Connection *self, int category, int limit)
2471-
/*[clinic end generated code: output=0d208213f8d68ccd input=9bd469537e195635]*/
2474+
/*[clinic end generated code: output=0d208213f8d68ccd input=5c2e430091206677]*/
24722475
{
24732476
if (!pysqlite_check_thread(self) || !pysqlite_check_connection(self)) {
24742477
return NULL;

0 commit comments

Comments
 (0)