8000 Merge branch 'main' into c-recursion-limit · python/cpython@a802ff6 · GitHub
[go: up one dir, main page]

Skip to content

Commit a802ff6

Browse files
committed
Merge branch 'main' into c-recursion-limit
2 parents 9da904d + 469d2e4 commit a802ff6

File tree

181 files changed

+3502
-1238
lines changed

Some content is hidden

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

181 files changed

+3502
-1238
lines changed

.github/workflows/build.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ jobs:
154154
Windows
155155
${{ fromJSON(matrix.free-threading) && '(free-threading)' || '' }}
156156
needs: build-context
157-
if: fromJSON(needs.build-context.outputs.run-tests)
157+
if: fromJSON(needs.build-context.outputs.run-windows-tests)
158158
strategy:
159159
fail-fast: false
160160
matrix:
@@ -654,13 +654,19 @@ jobs:
654654
build_ubuntu,
655655
build_ubuntu_ssltests,
656656
build_wasi,
657-
build_windows,
658657
build_asan,
659658
build_tsan,
660659
test_hypothesis,
661660
'
662661
|| ''
663662
}}
663+
${{
664+
!fromJSON(needs.build-context.outputs.run-windows-tests)
665+
&& '
666+
build_windows,
667+
'
668+
|| ''
669+
}}
664670
${{
665671
!fromJSON(needs.build-context.outputs.run-ci-fuzz)
666672
&& '

.github/workflows/reusable-context.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ on: # yamllint disable-line rule:truthy
2626
run-tests:
2727
description: Whether to run the regular tests
2828
value: ${{ jobs.compute-changes.outputs.run-tests }} # bool
29+
run-windows-tests:
30+
description: Whether to run the Windows tests
31+
value: ${{ jobs.compute-changes.outputs.run-windows-tests }} # bool
2932
run-windows-msi:
3033
description: Whether to run the MSI installer smoke tests
3134
value: ${{ jobs.compute-changes.outputs.run-windows-msi }} # bool
@@ -44,6 +47,7 @@ jobs:
4447
run-docs: ${{ steps.changes.outputs.run-docs }}
4548
run-tests: ${{ steps.changes.outputs.run-tests }}
4649
run-windows-msi: ${{ steps.changes.outputs.run-windows-msi }}
50+
run-windows-tests: ${{ steps.changes.outputs.run-windows-tests }}
4751
steps:
4852
- name: Set up Python
4953
uses: actions/setup-python@v5

Doc/c-api/bytearray.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ Direct API functions
7676
Resize the internal buffer of *bytearray* to *len*.
7777
Failure is a ``-1`` return with an exception set.
7878
79-
.. versionchanged:: next
79+
.. versionchanged:: 3.14
8080
A negative *len* will now result in an exception being set and -1 returned.
8181
8282

Doc/c-api/object.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -623,7 +623,7 @@ Object Protocol
623623
Objects that are immortal in one CPython version are not guaranteed to
624624
be immortal in another.
625625
626-
.. versionadded:: next
626+
.. versionadded:: 3.14
627627
628628
.. c:function:: int PyUnstable_TryIncRef(PyObject *obj)
629629

Doc/deprecations/pending-removal-in-3.15.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ Pending removal in Python 3.15
2929
* The :option:`!--cgi` flag to the :program:`python -m http.server`
3030
command-line interface has been deprecated since Python 3.13.
3131

32+
* :mod:`importlib`:
33+
34+
* ``load_module()`` method: use ``exec_module()`` instead.
35+
3236
* :class:`locale`:
3337

3438
* The :func:`~locale.getdefaultlocale` function
@@ -92,3 +96,9 @@ Pending removal in Python 3.15
9296
and :meth:`~wave.Wave_read.getmarkers` methods of
9397
the :class:`~wave.Wave_read` and :class:`~wave.Wave_write` classes
9498
have been deprecated since Python 3.13.
99+
100+
* :mod:`zipimport`:
101+
102+
* :meth:`~zipimport.zipimporter.load_module` has been deprecated since
103+
Python 3.10. Use :meth:`~zipimport.zipimporter.exec_module` instead.
104+
(Contributed by Jiahao Li in :gh:`125746`.)

Doc/deprecations/pending-removal-in-future.rst

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ although there is currently no date scheduled for their removal.
6363

6464
* :mod:`importlib`:
6565

66-
* ``load_module()`` method: use ``exec_module()`` instead.
6766
* :func:`~importlib.util.cache_from_source` *debug_override* parameter is
6867
deprecated: use the *optimization* parameter instead.
6968

@@ -152,6 +151,3 @@ although there is currently no date scheduled for their removal.
152151
:class:`~xml.etree.ElementTree.Element` is deprecated. In a future release it
153152
will always return ``True``. Prefer explicit ``len(elem)`` or
154153
``elem is not None`` tests instead.
155-
156-
* :meth:`zipimport.zipimporter.load_module` is deprecated:
157-
use :meth:`~zipimport.zipimporter.exec_module` instead.

Doc/library/asyncio-graph.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ a suspended *future*. These utilities and the underlying machinery
1717
can be used from within a Python program or by external profilers
1818
and debuggers.
1919

20-
.. versionadded:: next
20+
.. versionadded:: 3.14
2121

2222

2323
.. function:: print_call_graph(future=None, /, *, file=None, depth=1, limit=None)

Doc/library/contextvars.rst

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,21 @@ Context Variables
101101
the value of the variable to what it was before the corresponding
102102
*set*.
103103

104+
The token supports :ref:`context manager protocol <context-managers>`
105+
to restore the corresponding context variable value at the exit from
106+
:keyword:`with` block::
107+
108+
var = ContextVar('var', default='default value')
109+
110+
with var.set('new value'):
111+
assert var.get() == 'new value'
112+
113+
assert var.get() == 'default value'
114+
115+
.. versionadded:: next
116+
117+
Added support for usage as a context manager.
118+
104119
.. attribute:: Token.var
105120

106121
A read-only property. Points to the :class:`ContextVar` object

Doc/library/ctypes.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2117,7 +2117,7 @@ Utility functions
21172117
executable file. It may be an empty string.
21182118

21192119
.. availability:: Windows, macOS, iOS, glibc, BSD libc, musl
2120-
.. versionadded:: next
2120+
.. versionadded:: 3.14
21212121

21222122
.. function:: FormatError([code])
21232123

Doc/library/imaplib.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ An :class:`IMAP4` instance 10000 has the following methods:
392392
iteration, and public method to remain stable, but should not subclass,
393393
instantiate, compare, or otherwise directly reference the class.
394394

395-
.. versionadded:: next
395+
.. versionadded:: 3.14
396396

397397

398398
.. method:: IMAP4.list([directory[, pattern]])

Doc/library/importlib.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ ABC hierarchy::
370370
:exc:`NotImplementedError`. Functionality provided when
371371
:meth:`exec_module` is available.
372372

373-
.. deprecated:: 3.4
373+
.. deprecated-removed:: 3.4 3.15
374374
The recommended API for loading a module is :meth:`exec_module`
375375
(and :meth:`create_module`). Loaders should implement it instead of
376376
:meth:`load_module`. The import machinery takes care of all the
@@ -474,7 +474,7 @@ ABC hierarchy::
474474

475475
Implementation of :meth:`Loader.load_module`.
476476

477-
.. deprecated:: 3.4
477+
.. deprecated-removed:: 3.4 3.15
478478
use :meth:`exec_module` instead.
479479

480480

@@ -521,7 +521,7 @@ ABC hierarchy::
521521

522522
Calls super's ``load_module()``.
523523

524-
.. deprecated:: 3.4
524+
.. deprecated-removed:: 3.4 3.15
525525
Use :meth:`Loader.exec_module` instead.
526526

527527
.. abstractmethod:: get_filename(fullname)
@@ -610,7 +610,7 @@ ABC hierarchy::
610610

611611
Concrete implementation of :meth:`Loader.load_module`.
612612

613-
.. deprecated:: 3.4
613+
.. deprecated-removed:: 3.4 3.15
614614
Use :meth:`exec_module` instead.
615615

616616
.. method:: get_source(fullname)
@@ -1020,7 +1020,7 @@ find and load modules.
10201020
Concrete implementation of :meth:`importlib.abc.Loader.load_module` where
10211021
specifying the name of the module to load is optional.
10221022

1023-
.. deprecated:: 3.6
1023+
.. deprecated-removed:: 3.6 3.15
10241024

10251025
Use :meth:`importlib.abc.Loader.exec_module` instead.
10261026

@@ -1063,7 +1063,7 @@ find and load modules.
10631063
Concrete implementation of :meth:`importlib.abc.Loader.load_module` where
10641064
specifying the name of the module to load is optional.
10651065

1066-
.. deprecated:: 3.6
1066+
.. deprecated-removed:: 3.6 3.15
10671067

10681068
Use :meth:`importlib.abc.Loader.exec_module` instead.
10691069

Doc/library/inspect.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ attributes (see :ref:`import-mod-attrs` for module attributes):
316316

317317
Add ``__builtins__`` attribute to functions.
318318

319-
.. versionchanged:: next
319+
.. versionchanged:: 3.14
320320

321321
Add ``f_generator`` attribute to frames.
322322

Doc/library/os.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1683,7 +1683,7 @@ or `the MSDN <https://msdn.microsoft.com/en-us/library/z0kc8e3z.aspx>`_ on Windo
16831683
:meth:`io.BufferedIOBase.readinto`, :meth:`io.BufferedIOBase.read`, or
16841684
:meth:`io.TextIOBase.read`
16851685

1686-
.. versionadded:: next
1686+
.. versionadded:: 3.14
16871687

16881688

16891689
.. function:: sendfile(out_fd, in_fd, offset, count)

Doc/library/shutil.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,7 @@ file then shutil will silently fallback on using less efficient
529529
.. versionchanged:: 3.14
530530
Solaris now uses :func:`os.sendfile`.
531531

532-
.. versionchanged:: next
532+
.. versionchanged:: 3.14
533533
Copy-on-write or server-side copy may be used internally via
534534
:func:`os.copy_file_range` on supported Linux filesystems.
535535

Doc/library/stdtypes.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2871,7 +2871,7 @@ objects.
28712871
>>> (grow, len(grow))
28722872
(bytearray(b'abc\x00\x00'), 5)
28732873

2874-
.. versionadded:: next
2874+
.. versionadded:: 3.14
28752875

28762876
Since bytearray objects are sequences of integers (akin to a list), for a
28772877
bytearray object *b*, ``b[0]`` will be an integer, while ``b[0:1]`` will be

Doc/library/sys.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1280,7 +1280,7 @@ always available. Unless explicitly noted otherwise, all variables are read-only
12801280
to this function) are not guaranteed to be immortal in future versions,
12811281
and vice versa for mortal objects.
12821282

1283-
.. versionadded:: next
1283+
.. versionadded:: 3.14
12841284

12851285
.. impl-detail::
12861286

Doc/library/turtle.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1325,7 +1325,7 @@ Filling
13251325
>>> turtle.circle(80)
13261326
>>> turtle.end_fill()
13271327

1328-
.. versionadded:: next
1328+
.. versionadded:: 3.14
13291329

13301330

13311331
.. function:: begin_fill()
@@ -1713,7 +1713,7 @@ Special Turtle methods
17131713
... turtle.right(60)
17141714
... turtle.forward(100)
17151715

1716-
.. versionadded:: next
1716+
.. versionadded:: 3.14
17171717

17181718

17191719
.. function:: begin_poly()
@@ -2008,7 +2008,7 @@ Animation control
20082008
... fd(dist)
20092009
... rt(90)
20102010

2011-
.. versionadded:: next
2011+
.. versionadded:: 3.14
20122012

20132013

20142014
.. function:: delay(delay=None)

Doc/library/uuid.rst

Lines changed: 2 additions & 2 deletio 97AE ns
Original file line numberDiff line numberDiff line change
@@ -297,15 +297,15 @@ The :mod:`uuid` module defines the special Nil and Max UUID values:
297297
A special form of UUID that is specified to have all 128 bits set to zero
298298
according to :rfc:`RFC 9562, §5.9 <9562#section-5.9>`.
299299

300-
.. versionadded:: next
300+
.. versionadded:: 3.14
301301

302302

303303
.. data:: MAX
304304

305305
A special form of UUID that is specified to have all 128 bits set to one
306306
according to :rfc:`RFC 9562, §5.10 <9562#section-5.10>`.
307307

308-
.. versionadded:: next
308+
.. versionadded:: 3.14
309309

310310

311311
.. seealso::

Doc/library/zipimport.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ zipimporter Objects
148148
qualified (dotted) module name. Returns the imported module on success,
149149
raises :exc:`ZipImportError` on failure.
150150

151-
.. deprecated:: 3.10
151+
.. deprecated-removed:: 3.10 3.15
152152

153153
Use :meth:`exec_module` instead.
154154

Doc/using/configure.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -626,7 +626,7 @@ also be used to improve performance.
626626
`preserve_none <https://clang.llvm.org/docs/AttributeReference.html#preserve-none>`_
627627
calling convention. For example, Clang 19 and newer supports this feature.
628628

629-
.. versionadded:: next
629+
.. versionadded:: 3.14
630630

631631
.. option:: --without-mimalloc
632632

Doc/using/editors.rst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,19 @@
99
There are a number of IDEs that support Python programming language.
1010
Many editors and IDEs provide syntax highlighting, debugging tools, and :pep:`8` checks.
1111

12+
13+
IDLE --- Python editor and shell
14+
================================
15+
16+
IDLE is Python’s Integrated Development and Learning Environment and is generally bundled with Python installs.
17+
If you are on Linux and do not have IDLE installed see :ref:`Installing IDLE on Linux <installing_idle_on_linux>`.
18+
For more information see the :ref:`IDLE docs <idle>`.
19+
20+
21+
Other Editors and IDEs
22+
======================
23+
24+
Python's community wiki has information submitted by the community on Editors and IDEs.
1225
Please go to `Python Editors <https://wiki.python.org/moin/PythonEditors>`_ and
1326
`Integrated Development Environments <https://wiki.python.org/moin/IntegratedDevelopmentEnvironments>`_
1427
for a comprehensive list.

Doc/using/unix.rst

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,31 @@ look at the following links:
3535
https://slackbook.org/html/package-management-making-packages.html
3636
for Slackware users
3737

38+
.. _installing_idle_on_linux:
39+
40+
Installing IDLE
41+
~~~~~~~~~~~~~~~
42+
43+
In some cases, IDLE might not be included in your Python installation.
44+
45+
* For Debian and Ubuntu users::
46+
47+
sudo apt update
48+
sudo apt install idle
49+
50+
* For Fedora, RHEL, and CentOS users::
51+
52+
sudo dnf install python3-idle
53+
54+
* For SUSE and OpenSUSE users::
55+
56+
sudo zypper in python3-idle
57+
58+
* For Alpine Linux users::
59+
60+
sudo apk add python3-idle
61+
62+
3863

3964
On FreeBSD and OpenBSD
4065
----------------------

Doc/whatsnew/3.14.rst

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
****************************
32
What's new in Python 3.14
43
****************************
@@ -362,6 +361,13 @@ concurrent.futures
362361
supplying a *mp_context* to :class:`concurrent.futures.ProcessPoolExecutor`.
363362
(Contributed by Gregory P. Smith in :gh:`84559`.)
364363

364+
contextvars
365+
-----------
366+
367+
* Support context manager protocol by :class:`contextvars.Token`.
368+
(Contributed by Andrew Svetlov in :gh:`129889`.)
369+
370+
365371
ctypes
366372
------
367373

Include/patchlevel.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@
2121
#define PY_MINOR_VERSION 14
2222
#define PY_MICRO_VERSION 0
2323
#define PY_RELEASE_LEVEL PY_RELEASE_LEVEL_ALPHA
24-
#define PY_RELEASE_SERIAL 4
24+
#define PY_RELEASE_SERIAL 5
2525

2626
/* Version as a string */
27-
#define PY_VERSION "3.14.0a4+"
27+
#define PY_VERSION "3.14.0a5+"
2828
/*--end constants--*/
2929

3030

0 commit comments

Comments
 (0)
0