Skip to content

Commit 592d44b

Browse files
committed
Merge branch 'main' into defer-task-name-formatting
2 parents 712edf9 + e901588 commit 592d44b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+1122
-408
lines changed

.github/CODEOWNERS

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
configure* @erlend-aasland @corona10
1212

1313
# asyncio
14-
**/*asyncio* @1st1 @asvetlov @gvanrossum @kumaraditya303
14+
**/*asyncio* @1st1 @asvetlov @gvanrossum @kumaraditya303 @willingc
1515

1616
# Core
1717
**/*context* @1st1

.github/workflows/doc.yml

+2
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,13 @@ jobs:
5656

5757
# Add pull request annotations for Sphinx nitpicks (missing references)
5858
- name: 'Get list of changed files'
59+
if: github.event_name == 'pull_request'
5960
id: changed_files
6061
uses: Ana06/get-changed-files@v2.2.0
6162
with:
6263
filter: "Doc/**"
6364
- name: 'Build changed files in nit-picky mode'
65+
if: github.event_name == 'pull_request'
6466
continue-on-error: true
6567
run: |
6668
# Mark files the pull request modified

Doc/constraints.txt

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# We have upper bounds on our transitive dependencies here
2+
# To avoid new releases unexpectedly breaking our build.
3+
# This file can be updated on an ad-hoc basis,
4+
# though it will probably have to be updated
5+
# whenever Doc/requirements.txt is updated.
6+
7+
# Direct dependencies of Sphinx
8+
babel<3
9+
colorama<0.5
10+
imagesize<1.5
11+
Jinja2<3.2
12+
packaging<24
13+
# Pygments==2.15.0 breaks CI
14+
Pygments<2.16,!=2.15.0
15+
requests<3
16+
snowballstemmer<3
17+
sphinxcontrib-applehelp<1.1
18+
sphinxcontrib-devhelp<1.1
19+
sphinxcontrib-htmlhelp<2.1
20+
sphinxcontrib-jsmath<1.1
21+
sphinxcontrib-qthelp<1.1
22+
sphinxcontrib-serializinghtml<1.2
23+
24+
# Direct dependencies of Jinja2 (Jinja is a dependency of Sphinx, see above)
25+
MarkupSafe<2.2
26+
27+
# Direct dependencies of sphinx-lint
28+
polib<1.3
29+
regex<2024

Doc/library/asyncio-eventloop.rst

+11-11
Original file line numberDiff line numberDiff line change
@@ -1438,9 +1438,7 @@ async/await code consider using the high-level
14381438

14391439
* *stdin* can be any of these:
14401440

1441-
* a file-like object representing a pipe to be connected to the
1442-
subprocess's standard input stream using
1443-
:meth:`~loop.connect_write_pipe`
1441+
* a file-like object
14441442
* the :const:`subprocess.PIPE` constant (default) which will create a new
14451443
pipe and connect it,
14461444
* the value ``None`` which will make the subprocess inherit the file
@@ -1450,9 +1448,7 @@ async/await code consider using the high-level
14501448

14511449
* *stdout* can be any of these:
14521450

1453-
* a file-like object representing a pipe to be connected to the
1454-
subprocess's standard output stream using
1455-
:meth:`~loop.connect_write_pipe`
1451+
* a file-like object
14561452
* the :const:`subprocess.PIPE` constant (default) which will create a new
14571453
pipe and connect it,
14581454
* the value ``None`` which will make the subprocess inherit the file
@@ -1462,9 +1458,7 @@ async/await code consider using the high-level
14621458

14631459
* *stderr* can be any of these:
14641460

1465-
* a file-like object representing a pipe to be connected to the
1466-
subprocess's standard error stream using
1467-
:meth:`~loop.connect_write_pipe`
1461+
* a file-like object
14681462
* the :const:`subprocess.PIPE` constant (default) which will create a new
14691463
pipe and connect it,
14701464
* the value ``None`` which will make the subprocess inherit the file
@@ -1483,6 +1477,11 @@ async/await code consider using the high-level
14831477
as text. :func:`bytes.decode` can be used to convert the bytes returned
14841478
from the stream to text.
14851479

1480+
If a file-like object passed as *stdin*, *stdout* or *stderr* represents a
1481+
pipe, then the other side of this pipe should be registered with
1482+
:meth:`~loop.connect_write_pipe` or :meth:`~loop.connect_read_pipe` for use
1483+
with the event loop.
1484+
14861485
See the constructor of the :class:`subprocess.Popen` class
14871486
for documentation on other arguments.
14881487

@@ -1571,7 +1570,7 @@ Server objects are created by :meth:`loop.create_server`,
15711570
:meth:`loop.create_unix_server`, :func:`start_server`,
15721571
and :func:`start_unix_server` functions.
15731572

1574-
Do not instantiate the class directly.
1573+
Do not instantiate the :class:`Server` class directly.
15751574

15761575
.. class:: Server
15771576

@@ -1662,7 +1661,8 @@ Do not instantiate the class directly.
16621661

16631662
.. attribute:: sockets
16641663

1665-
List of :class:`socket.socket` objects the server is listening on.
1664+
List of socket-like objects, ``asyncio.trsock.TransportSocket``, which
1665+
the server is listening on.
16661666

16671667
.. versionchanged:: 3.7
16681668
Prior to Python 3.7 ``Server.sockets`` used to return an

Doc/library/smtplib.rst

+5-5
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Protocol) and :rfc:`1869` (SMTP Service Extensions).
2525

2626
An :class:`SMTP` instance encapsulates an SMTP connection. It has methods
2727
that support a full repertoire of SMTP and ESMTP operations. If the optional
28-
host and port parameters are given, the SMTP :meth:`connect` method is
28+
*host* and *port* parameters are given, the SMTP :meth:`connect` method is
2929
called with those parameters during initialization. If specified,
3030
*local_hostname* is used as the FQDN of the local host in the HELO/EHLO
3131
command. Otherwise, the local hostname is found using
@@ -34,12 +34,12 @@ Protocol) and :rfc:`1869` (SMTP Service Extensions).
3434
*timeout* parameter specifies a timeout in seconds for blocking operations
3535
like the connection attempt (if not specified, the global default timeout
3636
setting will be used). If the timeout expires, :exc:`TimeoutError` is
37-
raised. The optional source_address parameter allows binding
37+
raised. The optional *source_address* parameter allows binding
3838
to some specific source address in a machine with multiple network
3939
interfaces, and/or to some specific source TCP port. It takes a 2-tuple
40-
(host, port), for the socket to bind to as its source address before
41-
connecting. If omitted (or if host or port are ``''`` and/or 0 respectively)
42-
the OS default behavior will be used.
40+
``(host, port)``, for the socket to bind to as its source address before
41+
connecting. If omitted (or if *host* or *port* are ``''`` and/or ``0``
42+
respectively) the OS default behavior will be used.
4343

4444
For normal use, you should only require the initialization/connect,
4545
:meth:`sendmail`, and :meth:`SMTP.quit` methods.

Doc/library/sqlite3.rst

+76-2
Original file line numberDiff line numberDiff line change
@@ -573,6 +573,38 @@ Module constants
573573
package, a third-party library which used to upstream changes to
574574
:mod:`!sqlite3`. Today, it carries no meaning or practical value.
575575

576+
.. _sqlite3-dbconfig-constants:
577+
578+
.. data:: SQLITE_DBCONFIG_DEFENSIVE
579+
SQLITE_DBCONFIG_DQS_DDL
580+
SQLITE_DBCONFIG_DQS_DML
581+
SQLITE_DBCONFIG_ENABLE_FKEY
582+
SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER
583+
SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION
584+
SQLITE_DBCONFIG_ENABLE_QPSG
585+
SQLITE_DBCONFIG_ENABLE_TRIGGER
586+
SQLITE_DBCONFIG_ENABLE_VIEW
587+
SQLITE_DBCONFIG_LEGACY_ALTER_TABLE
588+
SQLITE_DBCONFIG_LEGACY_FILE_FORMAT
589+
SQLITE_DBCONFIG_NO_CKPT_ON_CLOSE
590+
SQLITE_DBCONFIG_RESET_DATABASE
591+
SQLITE_DBCONFIG_TRIGGER_EQP
592+
SQLITE_DBCONFIG_TRUSTED_SCHEMA
593+
SQLITE_DBCONFIG_WRITABLE_SCHEMA
594+
595+
These constants are used for the :meth:`Connection.setconfig`
596+
and :meth:`~Connection.getconfig` methods.
597+
598+
The availability of these constants varies depending on the version of SQLite
599+
Python was compiled with.
600+
601+
.. versionadded:: 3.12
602+
603+
.. seealso::
604+
605+
https://www.sqlite.org/c3ref/c_dbconfig_defensive.html
606+
SQLite docs: Database Connection Configuration Options
607+
576608

577609
.. _sqlite3-connection-objects:
578610

@@ -1041,19 +1073,37 @@ Connection objects
10411073
(2, 'broccoli pie', 'broccoli cheese onions flour')
10421074
(3, 'pumpkin pie', 'pumpkin sugar flour butter')
10431075

1044-
.. method:: load_extension(path, /)
1076+
.. method:: load_extension(path, /, *, entrypoint=None)
10451077

1046-
Load an SQLite extension from a shared library located at *path*.
1078+
Load an SQLite extension from a shared library.
10471079
Enable extension loading with :meth:`enable_load_extension` before
10481080
calling this method.
10491081

1082+
:param str path:
1083+
1084+
The path to the SQLite extension.
1085+
1086+
:param entrypoint:
1087+
1088+
Entry point name.
1089+
If ``None`` (the default),
1090+
SQLite will come up with an entry point name of its own;
1091+
see the SQLite docs `Loading an Extension`_ for details.
1092+
1093+
:type entrypoint: str | None
1094+
10501095
.. audit-event:: sqlite3.load_extension connection,path sqlite3.Connection.load_extension
10511096

10521097
.. versionadded:: 3.2
10531098

10541099
.. versionchanged:: 3.10
10551100
Added the ``sqlite3.load_extension`` auditing event.
10561101

1102+
.. versionadded:: 3.12
1103+
The *entrypoint* parameter.
1104+
1105+
.. _Loading an Extension: https://www.sqlite.org/loadext.html#loading_an_extension_
1106+
10571107
.. method:: iterdump
10581108

10591109
Return an :term:`iterator` to dump the database as SQL source code.
@@ -1201,6 +1251,30 @@ Connection objects
12011251
.. _SQLite limit category: https://www.sqlite.org/c3ref/c_limit_attached.html
12021252

12031253

1254+
.. method:: getconfig(op, /)
1255+
1256+
Query a boolean connection configuration option.
1257+
1258+
:param int op:
1259+
A :ref:`SQLITE_DBCONFIG code <sqlite3-dbconfig-constants>`.
1260+
1261+
:rtype: bool
1262+
1263+
.. versionadded:: 3.12
1264+
1265+
.. method:: setconfig(op, enable=True, /)
1266+
1267+
Set a boolean connection configuration option.
1268+
1269+
:param int op:
1270+
A :ref:`SQLITE_DBCONFIG code <sqlite3-dbconfig-constants>`.
1271+
1272+
:param bool enable:
1273+
``True`` if the configuration option should be enabled (default);
1274+
``False`` if it should be disabled.
1275+
1276+
.. versionadded:: 3.12
1277+
12041278
.. method:: serialize(*, name="main")
12051279

12061280
Serialize a database into a :class:`bytes` object. For an

Doc/library/tempfile.rst

+3
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,9 @@ The module defines the following user-callable items:
292292
.. versionchanged:: 3.6
293293
The *dir* parameter now accepts a :term:`path-like object`.
294294

295+
.. versionchanged:: 3.12
296+
:func:`mkdtemp` now always returns an absolute path, even if *dir* is relative.
297+
295298

296299
.. function:: gettempdir()
297300

Doc/library/types.rst

+7
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,13 @@ Standard names are defined for the following types:
351351
.. versionchanged:: 3.9.2
352352
This type can now be subclassed.
353353

354+
.. seealso::
355+
356+
:ref:`Generic Alias Types<types-genericalias>`
357+
In-depth documentation on instances of :class:`!types.GenericAlias`
358+
359+
:pep:`585` - Type Hinting Generics In Standard Collections
360+
Introducing the :class:`!types.GenericAlias` class
354361

355362
.. class:: UnionType
356363

Doc/requirements.txt

+5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
# Requirements to build the Python documentation
2+
#
3+
# Note that when updating this file, you will likely also have to update
4+
# the Doc/constraints.txt file.
25

36
# Sphinx version is pinned so that new versions that introduce new warnings
47
# won't suddenly cause build failures. Updating the version is fine as long
@@ -13,3 +16,5 @@ sphinxext-opengraph==0.7.5
1316
# The theme used by the documentation is stored separately, so we need
1417
# to install that as well.
1518
python-docs-theme>=2022.1
19+
20+
-c constraints.txt

Doc/whatsnew/3.12.rst

+14-2
Original file line numberDiff line numberDiff line change
@@ -406,6 +406,16 @@ sqlite3
406406
:ref:`transaction handling <sqlite3-transaction-control-autocommit>`.
407407
(Contributed by Erlend E. Aasland in :gh:`83638`.)
408408

409+
* Add *entrypoint* keyword-only parameter to
410+
:meth:`~sqlite3.Connection.load_extension`,
411+
for overriding the SQLite extension entry point.
412+
(Contributed by Erlend E. Aasland in :gh:`103015`.)
413+
414+
* Add :meth:`~sqlite3.Connection.getconfig` and
415+
:meth:`~sqlite3.Connection.setconfig` to :class:`~sqlite3.Connection`
416+
to make configuration changes to a database connection.
417+
(Contributed by Erlend E. Aasland in :gh:`103489`.)
418+
409419
threading
410420
---------
411421

@@ -457,8 +467,10 @@ uuid
457467
tempfile
458468
--------
459469

460-
The :class:`tempfile.NamedTemporaryFile` function has a new optional parameter
461-
*delete_on_close* (Contributed by Evgeny Zorin in :gh:`58451`.)
470+
* The :class:`tempfile.NamedTemporaryFile` function has a new optional parameter
471+
*delete_on_close* (Contributed by Evgeny Zorin in :gh:`58451`.)
472+
* :func:`tempfile.mkdtemp` now always returns an absolute path, even if the
473+
argument provided to the *dir* parameter is a relative path.
462474

463475
.. _whatsnew-typing-py312:
464476

Include/internal/pycore_code.h

+11
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,15 @@ typedef struct {
5151

5252
#define INLINE_CACHE_ENTRIES_BINARY_SUBSCR CACHE_ENTRIES(_PyBinarySubscrCache)
5353

54+
typedef struct {
55+
uint16_t counter;
56+
uint16_t class_version[2];
57+
uint16_t self_type_version[2];
58+
uint16_t method[4];
59+
} _PySuperAttrCache;
60+
61+
#define INLINE_CACHE_ENTRIES_LOAD_SUPER_ATTR CACHE_ENTRIES(_PySuperAttrCache)
62+
5463
typedef struct {
5564
uint16_t counter;
5665
uint16_t version[2];
@@ -217,6 +226,8 @@ extern int _PyLineTable_PreviousAddressRange(PyCodeAddressRange *range);
217226

218227
/* Specialization functions */
219228

229+
extern void _Py_Specialize_LoadSuperAttr(PyObject *global_super, PyObject *class, PyObject *self,
230+
_Py_CODEUNIT *instr, PyObject *name, int load_method);
220231
extern void _Py_Specialize_LoadAttr(PyObject *owner, _Py_CODEUNIT *instr,
221232
PyObject *name);
222233
extern void _Py_Specialize_StoreAttr(PyObject *owner, _Py_CODEUNIT *instr,

Include/internal/pycore_global_objects_fini_generated.h

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Include/internal/pycore_global_strings.h

+1
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,7 @@ struct _Py_global_strings {
378378
STRUCT_FOR_ID(end_lineno)
379379
STRUCT_FOR_ID(end_offset)
380380
STRUCT_FOR_ID(endpos)
381+
STRUCT_FOR_ID(entrypoint)
381382
STRUCT_FOR_ID(env)
382383
STRUCT_FOR_ID(errors)
383384
STRUCT_FOR_ID(event)

0 commit comments

Comments
 (0)