Skip to content

Commit d9940f6

Browse files
[3.13] gh-150285: Fix too long docstrings in the sqlite3 module (GH-150290) (GH-150461)
(cherry picked from commit 7168b02) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com> (cherry picked from commit 0466560)
1 parent 7d265b6 commit d9940f6

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
@@ -167,14 +167,14 @@ _sqlite3.Blob.read as blob_read
167167
168168
Read data at the current offset position.
169169
170-
If the end of the blob is reached, the data up to end of file will be returned.
171-
When length is not specified, or is negative, Blob.read() will read until the
172-
end of the blob.
170+
If the end of the blob is reached, the data up to end of file will
171+
be returned. When length is not specified, or is negative,
172+
Blob.read() will read until the end of the blob.
173173
[clinic start generated code]*/
174174

175175
static PyObject *
176176
blob_read_impl(pysqlite_Blob *self, int length)
177-
/*[clinic end generated code: output=1fc99b2541360dde input=f2e4aa4378837250]*/
177+
/*[clinic end generated code: output=1fc99b2541360dde input=6b745ad37720e556]*/
178178
{
179179
if (!check_blob(self)) {
180180
return NULL;
@@ -234,13 +234,13 @@ _sqlite3.Blob.write as blob_write
234234
235235
Write data at the current offset.
236236
237-
This function cannot change the blob length. Writing beyond the end of the
238-
blob will result in an exception being raised.
237+
This function cannot change the blob length. Writing beyond the end
238+
of the blob will result in an exception being raised.
239239
[clinic start generated code]*/
240240

241241
static PyObject *
242242
blob_write_impl(pysqlite_Blob *self, Py_buffer *data)
243-
/*[clinic end generated code: output=b34cf22601b570b2 input=a84712f24a028e6d]*/
243+
/*[clinic end generated code: output=b34cf22601b570b2 input=0d372cb0240a5d49]*/
244244
{
245245
if (!check_blob(self)) {
246246
return NULL;
@@ -264,14 +264,15 @@ _sqlite3.Blob.seek as blob_seek
264264
265265
Set the current access position to offset.
266266
267-
The origin argument defaults to os.SEEK_SET (absolute blob positioning).
268-
Other values for origin are os.SEEK_CUR (seek relative to the current position)
269-
and os.SEEK_END (seek relative to the blob's end).
267+
The origin argument defaults to os.SEEK_SET (absolute blob
268+
positioning). Other values for origin are os.SEEK_CUR (seek
269+
relative to the current position) and os.SEEK_END (seek relative to
270+
the blob's end).
270271
[clinic start generated code]*/
271272

272273
static PyObject *
273274
blob_seek_impl(pysqlite_Blob *self, int offset, int origin)
274-
/*[clinic end generated code: output=854c5a0e208547a5 input=5da9a07e55fe6bb6]*/
275+
/*[clinic end generated code: output=854c5a0e208547a5 input=84aea1b6b48607dd]*/
275276
{
276277
if (!check_blob(self)) {
277278
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
@@ -1590,23 +1590,24 @@ _sqlite3.Connection.set_progress_handler as pysqlite_connection_set_progress_han
15901590
cls: defining_class
15911591
progress_handler as callable: object
15921592
A callable that takes no arguments.
1593-
If the callable returns non-zero, the current query is terminated,
1594-
and an exception is raised.
1593+
If the callable returns non-zero, the current query is
1594+
terminated, and an exception is raised.
15951595
/ [from 3.15]
15961596
n: int
15971597
The number of SQLite virtual machine instructions that are
15981598
executed between invocations of 'progress_handler'.
15991599
16001600
Set progress handler callback.
16011601
1602-
If 'progress_handler' is None or 'n' is 0, the progress handler is disabled.
1602+
If 'progress_handler' is None or 'n' is 0, the progress handler is
1603+
disabled.
16031604
[clinic start generated code]*/
16041605

16051606
static PyObject *
16061607
pysqlite_connection_set_progress_handler_impl(pysqlite_Connection *self,
16071608
PyTypeObject *cls,
16081609
PyObject *callable, int n)
1609-
/*[clinic end generated code: output=0739957fd8034a50 input=b4d6e2ef8b4d32f9]*/
1610+
/*[clinic end generated code: output=0739957fd8034a50 input=d46887797f0c0ecf]*/
16101611
{
16111612
if (!pysqlite_check_thread(self) || !pysqlite_check_connection(self)) {
16121613
return NULL;
@@ -2234,15 +2235,15 @@ _sqlite3.Connection.serialize as serialize
22342235
22352236
Serialize a database into a byte string.
22362237
2237-
For an ordinary on-disk database file, the serialization is just a copy of the
2238-
disk file. For an in-memory database or a "temp" database, the serialization is
2239-
the same sequence of bytes which would be written to disk if that database
2240-
were backed up to disk.
2238+
For an ordinary on-disk database file, the serialization is just
2239+
a copy of the disk file. For an in-memory database or a "temp"
2240+
database, the serialization is the same sequence of bytes which
2241+
would be written to disk if that database were backed up to disk.
22412242
[clinic start generated code]*/
22422243

22432244
static PyObject *
22442245
serialize_impl(pysqlite_Connection *self, const char *name)
2245-
/*[clinic end generated code: output=97342b0e55239dd3 input=d2eb5194a65abe2b]*/
2246+
/*[clinic end generated code: output=97342b0e55239dd3 input=7e48654e8e082fa8]*/
22462247
{
22472248
if (!pysqlite_check_thread(self) || !pysqlite_check_connection(self)) {
22482249
return NULL;
@@ -2287,18 +2288,19 @@ _sqlite3.Connection.deserialize as deserialize
22872288
22882289
Load a serialized database.
22892290
2290-
The deserialize interface causes the database connection to disconnect from the
2291-
target database, and then reopen it as an in-memory database based on the given
2292-
serialized data.
2291+
The deserialize interface causes the database connection to
2292+
disconnect from the target database, and then reopen it as
2293+
an in-memory database based on the given serialized data.
22932294
2294-
The deserialize interface will fail with SQLITE_BUSY if the database is
2295-
currently in a read transaction or is involved in a backup operation.
2295+
The deserialize interface will fail with SQLITE_BUSY if the database
2296+
is currently in a read transaction or is involved in a backup
2297+
operation.
22962298
[clinic start generated code]*/
22972299

22982300
static PyObject *
22992301
deserialize_impl(pysqlite_Connection *self, Py_buffer *data,
23002302
const char *name)
2301-
/*[clinic end generated code: output=e394c798b98bad89 input=1be4ca1faacf28f2]*/
2303+
/*[clinic end generated code: output=e394c798b98bad89 input=5d20e028d98c0686]*/
23022304
{
23032305
if (!pysqlite_check_thread(self) || !pysqlite_check_connection(self)) {
23042306
return NULL;
@@ -2371,13 +2373,14 @@ _sqlite3.Connection.__exit__ as pysqlite_connection_exit
23712373
23722374
Called when the connection is used as a context manager.
23732375
2374-
If there was any exception, a rollback takes place; otherwise we commit.
2376+
If there was any exception, a rollback takes place; otherwise we
2377+
commit.
23752378
[clinic start generated code]*/
23762379

23772380
static PyObject *
23782381
pysqlite_connection_exit_impl(pysqlite_Connection *self, PyObject *exc_type,
23792382
PyObject *exc_value, PyObject *exc_tb)
2380-
/*[clinic end generated code: output=0705200e9321202a input=bd66f1532c9c54a7]*/
2383+
/*[clinic end generated code: output=0705200e9321202a input=8fdb0392ee6f3466]*/
23812384
{
23822385
int commit = 0;
23832386
PyObject* result;
@@ -2417,20 +2420,20 @@ _sqlite3.Connection.setlimit as setlimit
24172420
category: int
24182421
The limit category to be set.
24192422
limit: int
2420-
The new limit. If the new limit is a negative number, the limit is
2421-
unchanged.
2423+
The new limit. If the new limit is a negative number, the limit
2424+
is unchanged.
24222425
/
24232426
24242427
Set connection run-time limits.
24252428
2426-
Attempts to increase a limit above its hard upper bound are silently truncated
2427-
to the hard upper bound. Regardless of whether or not the limit was changed,
2428-
the prior value of the limit is returned.
2429+
Attempts to increase a limit above its hard upper bound are silently
2430+
truncated to the hard upper bound. Regardless of whether or not the
2431+
limit was changed, the prior value of the limit is returned.
24292432
[clinic start generated code]*/
24302433

24312434
static PyObject *
24322435
setlimit_impl(pysqlite_Connection *self, int category, int limit)
2433-
/*[clinic end generated code: output=0d208213f8d68ccd input=9bd469537e195635]*/
2436+
/*[clinic end generated code: output=0d208213f8d68ccd input=5c2e430091206677]*/
24342437
{
24352438
if (!pysqlite_check_thread(self) || !pysqlite_check_connection(self)) {
24362439
return NULL;

0 commit comments

Comments
 (0)