Skip to content

Commit 602f97c

Browse files
authored
Merge branch '3.12' into bp-e85f2f1703e0f79cfd0d0e3010190b71c0eb18da
2 parents 7af4016 + 3a726be commit 602f97c

34 files changed

+482
-68
lines changed

.github/workflows/reusable-macos.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
run: |
4242
brew install pkg-config openssl@3.0 xz gdbm tcl-tk@8
4343
# Because alternate versions are not symlinked into place by default:
44-
brew link tcl-tk@8
44+
brew link --overwrite tcl-tk@8
4545
- name: Configure CPython
4646
run: |
4747
GDBM_CFLAGS="-I$(brew --prefix gdbm)/include" \

Doc/library/itertools.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -664,7 +664,7 @@ loops that truncate the stream.
664664
consumed from the input iterator and there is no way to access it.
665665
This could be an issue if an application wants to further consume the
666666
input iterator after *takewhile* has been run to exhaustion. To work
667-
around this problem, consider using `more-iterools before_and_after()
667+
around this problem, consider using `more-itertools before_and_after()
668668
<https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.before_and_after>`_
669669
instead.
670670

Doc/library/ssl.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2369,8 +2369,8 @@ thus several things you need to be aware of:
23692369
.. seealso::
23702370

23712371
The :mod:`asyncio` module supports :ref:`non-blocking SSL sockets
2372-
<ssl-nonblocking>` and provides a
2373-
higher level API. It polls for events using the :mod:`selectors` module and
2372+
<ssl-nonblocking>` and provides a higher level :ref:`Streams API <asyncio-streams>`.
2373+
It polls for events using the :mod:`selectors` module and
23742374
handles :exc:`SSLWantWriteError`, :exc:`SSLWantReadError` and
23752375
:exc:`BlockingIOError` exceptions. It runs the SSL handshake asynchronously
23762376
as well.

Doc/reference/compound_stmts.rst

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -534,15 +534,18 @@ is semantically equivalent to::
534534
enter = type(manager).__enter__
535535
exit = type(manager).__exit__
536536
value = enter(manager)
537+
hit_except = False
537538

538539
try:
539540
TARGET = value
540541
SUITE
541542
except:
543+
hit_except = True
542544
if not exit(manager, *sys.exc_info()):
543545
raise
544-
else:
545-
exit(manager, None, None, None)
546+
finally:
547+
if not hit_except:
548+
exit(manager, None, None, None)
546549

547550
With more than one item, the context managers are processed as if multiple
548551
:keyword:`with` statements were nested::

Doc/requirements-oldest-sphinx.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@ python-docs-theme>=2022.1
1313
# Sphinx 7.2.6 comes from ``needs_sphinx = '7.2.6'`` in ``Doc/conf.py``.
1414

1515
alabaster==0.7.16
16-
Babel==2.16.0
17-
certifi==2024.8.30
16+
babel==2.16.0
17+
certifi==2024.12.14
1818
charset-normalizer==3.4.0
1919
docutils==0.20.1
2020
idna==3.10
2121
imagesize==1.4.1
22-
Jinja2==3.1.4
23-
MarkupSafe==3.0.1
24-
packaging==24.1
22+
Jinja2==3.1.5
23+
MarkupSafe==3.0.2
24+
packaging==24.2
2525
Pygments==2.18.0
2626
requests==2.32.3
2727
snowballstemmer==2.2.0
@@ -32,4 +32,4 @@ sphinxcontrib-htmlhelp==2.1.0
3232
sphinxcontrib-jsmath==1.0.1
3333
sphinxcontrib-qthelp==2.0.0
3434
sphinxcontrib-serializinghtml==2.0.0
35-
urllib3==2.2.3
35+
urllib3==2.3.0

Include/internal/pycore_pyerrors.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,18 @@ PyAPI_FUNC(void) _PyErr_SetString(
7575
PyObject *exception,
7676
const char *string);
7777

78+
/*
79+
* Set an exception with the error message decoded from the current locale
80+
* encoding (LC_CTYPE).
81+
*
82+
* Exceptions occurring in decoding take priority over the desired exception.
83+
*
84+
* Exported for '_ctypes' shared extensions.
85+
*/
86+
PyAPI_FUNC(void) _PyErr_SetLocaleString(
87+
PyObject *exception,
88+
const char *string);
89+
7890
PyAPI_FUNC(PyObject *) _PyErr_Format(
7991
PyThreadState *tstate,
8092
PyObject *exception,

Lib/asyncio/runners.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ def run(main, *, debug=None, loop_factory=None):
168168
running in the same thread.
169169
170170
If debug is True, the event loop will be run in debug mode.
171+
If loop_factory is passed, it is used for new event loop creation.
171172
172173
This function always creates a new event loop and closes it at the end.
173174
It should be used as a main entry point for asyncio programs, and should

Lib/functools.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,9 @@ def __setstate__(self, state):
340340
self.args = args
341341
self.keywords = kwds
342342

343+
__class_getitem__ = classmethod(GenericAlias)
344+
345+
343346
try:
344347
from _functools import partial
345348
except ImportError:

Lib/test/test_cext/__init__.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,14 @@
88
import shlex
99
import shutil
1010
import subprocess
11+
import sys
1112
import unittest
1213
from test import support
1314

1415

1516
SOURCE = os.path.join(os.path.dirname(__file__), 'extension.c')
1617
SETUP = os.path.join(os.path.dirname(__file__), 'setup.py')
18+
Py_TRACE_REFS = hasattr(sys, 'getobjects')
1719

1820

1921
# With MSVC on a debug build, the linker fails with: cannot open file
@@ -47,6 +49,9 @@ def test_build_limited_c11(self):
4749
self.check_build('_test_limited_c11_cext', limited=True, std='c11')
4850

4951
def check_build(self, extension_name, std=None, limited=False):
52+
if limited and Py_TRACE_REFS:
53+
self.skipTest('Py_LIMITED_API is incompatible with Py_TRACE_REFS')
54+
5055
venv_dir = 'env'
5156
with support.setup_venv_with_pip_setuptools_wheel(venv_dir) as python_exe:
5257
self._check_build(extension_name, python_exe,

Lib/test/test_cppext/__init__.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,14 @@
44
import shlex
55
import shutil
66
import subprocess
7+
import sys
78
import unittest
89
from test import support
910

1011

1112
SOURCE = os.path.join(os.path.dirname(__file__), 'extension.cpp')
1213
SETUP = os.path.join(os.path.dirname(__file__), 'setup.py')
14+
Py_TRACE_REFS = hasattr(sys, 'getobjects')
1315

1416

1517
# With MSVC on a debug build, the linker fails with: cannot open file
@@ -45,6 +47,9 @@ def test_build_limited(self):
4547
self.check_build('_testcppext_limited', limited=True)
4648

4749
def check_build(self, extension_name, std=None, limited=False):
50+
if limited and Py_TRACE_REFS:
51+
self.skipTest('Py_LIMITED_API is incompatible with Py_TRACE_REFS')
52+
4853
venv_dir = 'env'
4954
with support.setup_venv_with_pip_setuptools_wheel(venv_dir) as python_exe:
5055
self._check_build(extension_name, python_exe,

0 commit comments

Comments
 (0)