Skip to content

Commit 48c87aa

Browse files
Merge branch 'main' into fix-pyxi-freeexcinfo-null-guard
2 parents 7d517f5 + 7928a8b commit 48c87aa

75 files changed

Lines changed: 3898 additions & 281 deletions

File tree

Some content is hidden

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

.github/workflows/jit.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,10 @@ jobs:
6464
include:
6565
- target: i686-pc-windows-msvc/msvc
6666
architecture: Win32
67-
runner: windows-2025-vs2026
67+
runner: windows-2025
6868
- target: x86_64-pc-windows-msvc/msvc
6969
architecture: x64
70-
runner: windows-2025-vs2026
70+
runner: windows-2025
7171
- target: aarch64-pc-windows-msvc/msvc
7272
architecture: ARM64
7373
runner: windows-11-arm

.github/workflows/reusable-windows-msi.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ env:
1717
jobs:
1818
build:
1919
name: installer for ${{ inputs.arch }}
20-
runs-on: ${{ inputs.arch == 'arm64' && 'windows-11-arm' || 'windows-2025-vs2026' }}
20+
runs-on: ${{ inputs.arch == 'arm64' && 'windows-11-arm' || 'windows-2025' }}
2121
timeout-minutes: 60
2222
env:
2323
ARCH: ${{ inputs.arch }}

.github/workflows/reusable-windows.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ env:
2626
jobs:
2727
build:
2828
name: Build and test (${{ inputs.arch }}, ${{ inputs.interpreter }})
29-
runs-on: ${{ inputs.arch == 'arm64' && 'windows-11-arm' || 'windows-2025-vs2026' }}
29+
runs-on: ${{ inputs.arch == 'arm64' && 'windows-11-arm' || 'windows-2025' }}
3030
timeout-minutes: 60
3131
env:
3232
ARCH: ${{ inputs.arch }}

.readthedocs.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,21 @@ build:
1111
os: ubuntu-24.04
1212
tools:
1313
python: "3"
14+
apt_packages:
15+
- jq
1416

1517
jobs:
16-
post_checkout:
18+
post_system_dependencies:
1719
# https://docs.readthedocs.com/platform/stable/guides/build/skip-build.html#skip-builds-based-on-conditions
1820
#
19-
# Cancel building pull requests when there aren't changes in the Doc
21+
# Cancel building pull requests when there are no changes in the Doc
2022
# directory or RTD configuration, or if we can't cleanly merge the base
2123
# branch.
2224
- |
2325
set -eEux;
2426
if [ "$READTHEDOCS_VERSION_TYPE" = "external" ];
2527
then
26-
base_branch=main;
28+
base_branch=$(wget -qO- "https://api.github.com/repos/python/cpython/pulls/$READTHEDOCS_VERSION" | jq -er ".base.ref");
2729
git fetch --depth=50 origin $base_branch:origin-$base_branch;
2830
for attempt in $(seq 10);
2931
do

Doc/deprecations/index.rst

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
Deprecations
22
============
33

4-
.. include:: pending-removal-in-3.16.rst
5-
64
.. include:: pending-removal-in-3.17.rst
75

86
.. include:: pending-removal-in-3.18.rst
@@ -20,8 +18,6 @@ Deprecations
2018
C API deprecations
2119
------------------
2220

23-
.. include:: c-api-pending-removal-in-3.16.rst
24-
2521
.. include:: c-api-pending-removal-in-3.18.rst
2622

2723
.. include:: c-api-pending-removal-in-3.19.rst

Doc/extending/extending.rst

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -231,10 +231,8 @@ calling the Python callback functions from a C callback. Other uses are also
231231
imaginable.
232232

233233
Fortunately, the Python interpreter is easily called recursively, and there is a
234-
standard interface to call a Python function. (I won't dwell on how to call the
235-
Python parser with a particular string as input --- if you're interested, have a
236-
look at the implementation of the :option:`-c` command line option in
237-
:file:`Modules/main.c` from the Python source code.)
234+
standard interface to call a Python function. (If you're interested in how to call the
235+
Python parser with a particular string as input, see :ref:`veryhigh`.)
238236

239237
Calling a Python function is easy. First, the Python program must somehow pass
240238
you the Python function object. You should provide a function (or some other
@@ -641,7 +639,7 @@ and the object is freed.
641639

642640
An alternative strategy is called :dfn:`automatic garbage collection`.
643641
(Sometimes, reference counting is also referred to as a garbage collection
644-
strategy, hence my use of "automatic" to distinguish the two.) The big
642+
strategy, hence the use of "automatic" to distinguish the two.) The big
645643
advantage of automatic garbage collection is that the user doesn't need to call
646644
:c:func:`free` explicitly. (Another claimed advantage is an improvement in speed
647645
or memory usage --- this is no hard fact however.) The disadvantage is that for

Doc/library/codecs.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1399,6 +1399,14 @@ encodings.
13991399
| punycode | | Implement :rfc:`3492`. |
14001400
| | | Stateful codecs are not |
14011401
| | | supported. |
1402+
| | | |
1403+
| | | .. warning:: |
1404+
| | | |
1405+
| | | The decoding and |
1406+
| | | encoding algorithms |
1407+
| | | scale poorly, so |
1408+
| | | limit the length of |
1409+
| | | untrusted input. |
14021410
+--------------------+---------+---------------------------+
14031411
| raw_unicode_escape | | Latin-1 encoding with |
14041412
| | | :samp:`\\u{XXXX}` and |

Doc/library/csv.rst

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,13 @@ The :mod:`!csv` module defines the following functions:
8181
Spam, Spam, Spam, Spam, Spam, Baked Beans
8282
Spam, Lovely Spam, Wonderful Spam
8383

84+
where :file:`eggs.csv` contains:
85+
86+
.. code-block:: text
87+
88+
Spam Spam Spam Spam Spam |Baked Beans|
89+
Spam |Lovely Spam| |Wonderful Spam|
90+
8491
8592
.. function:: writer(csvfile, /, dialect='excel', **fmtparams)
8693

@@ -110,6 +117,13 @@ The :mod:`!csv` module defines the following functions:
110117
spamwriter.writerow(['Spam'] * 5 + ['Baked Beans'])
111118
spamwriter.writerow(['Spam', 'Lovely Spam', 'Wonderful Spam'])
112119

120+
which writes :file:`eggs.csv` containing:
121+
122+
.. code-block:: text
123+
124+
Spam Spam Spam Spam Spam |Baked Beans|
125+
Spam |Lovely Spam| |Wonderful Spam|
126+
113127
114128
.. function:: register_dialect(name, /, dialect='excel', **fmtparams)
115129

@@ -191,6 +205,14 @@ The :mod:`!csv` module defines the following classes:
191205
>>> print(row)
192206
{'first_name': 'John', 'last_name': 'Cleese'}
193207

208+
where :file:`names.csv` contains:
209+
210+
.. code-block:: text
211+
212+
first_name,last_name
213+
Eric,Idle
214+
John,Cleese
215+
194216
195217
.. class:: DictWriter(f, fieldnames, restval='', extrasaction='raise', \
196218
dialect='excel', *args, **kwds)
@@ -228,6 +250,15 @@ The :mod:`!csv` module defines the following classes:
228250
writer.writerow({'first_name': 'Lovely', 'last_name': 'Spam'})
229251
writer.writerow({'first_name': 'Wonderful', 'last_name': 'Spam'})
230252

253+
which writes :file:`names.csv` containing:
254+
255+
.. code-block:: text
256+
257+
first_name,last_name
258+
Baked,Beans
259+
Lovely,Spam
260+
Wonderful,Spam
261+
231262
232263
.. class:: Dialect
233264

Doc/library/dialog.rst

Lines changed: 57 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,41 @@ The :mod:`!tkinter.simpledialog` module contains convenience classes and
1515
functions for creating simple modal dialogs to get a value from the user.
1616

1717

18-
.. function:: askfloat(title, prompt, **kw)
19-
askinteger(title, prompt, **kw)
20-
askstring(title, prompt, **kw)
18+
.. function:: askfloat(title, prompt, *, initialvalue=None, minvalue=None, maxvalue=None, parent=None, use_ttk=True)
19+
askinteger(title, prompt, *, initialvalue=None, minvalue=None, maxvalue=None, parent=None, use_ttk=True)
20+
askstring(title, prompt, *, initialvalue=None, show=None, parent=None, use_ttk=True)
2121
22-
The above three functions provide dialogs that prompt the user to enter a value
23-
of the desired type.
22+
Prompt the user to enter a value of the desired type and return it, or
23+
``None`` if the dialog is cancelled.
24+
25+
*title* is the dialog title and *prompt* the message shown above the entry.
26+
*initialvalue* is the value initially placed in the entry.
27+
*parent* is the window over which the dialog is shown.
28+
:func:`askinteger` and :func:`askfloat` also accept *minvalue* and
29+
*maxvalue*, which bound the accepted value.
30+
:func:`askstring` also accepts *show*, a character used to mask the entered
31+
text, for example ``'*'`` to hide a password.
32+
They use the themed :mod:`tkinter.ttk` widgets; pass ``use_ttk=False`` for
33+
the classic widgets.
2434

25-
.. class:: Dialog(parent, title=None)
35+
.. class:: Dialog(parent, title=None, *, use_ttk=False)
2636

2737
The base class for custom dialogs.
38+
Instantiating it shows the dialog modally and returns once the user closes
39+
it; the entered value is then available in the :attr:`!result` attribute.
40+
When *use_ttk* is false (the default), the dialog is built from the classic
41+
:mod:`tkinter` widgets, modelled on the classic ``tk_dialog``; when true,
42+
from the themed :mod:`tkinter.ttk` widgets, modelled on the Tk message box.
43+
The default is classic for compatibility, since the themed widgets set a
44+
themed background that classic widgets added in :meth:`body` would not match.
45+
46+
.. versionchanged:: next
47+
Added the *use_ttk* parameter.
48+
49+
.. attribute:: result
50+
51+
The value produced by :meth:`apply`, or ``None`` if the dialog was
52+
cancelled.
2853

2954
.. method:: body(master)
3055

@@ -46,7 +71,8 @@ functions for creating simple modal dialogs to get a value from the user.
4671

4772
.. method:: apply()
4873

49-
Process the data entered by the user.
74+
Process the data entered by the user, for example by storing it in the
75+
:attr:`!result` attribute.
5076
Called after :meth:`validate` succeeds and just before the dialog is
5177
destroyed.
5278
The default implementation does nothing; override it to act on or store
@@ -58,14 +84,32 @@ functions for creating simple modal dialogs to get a value from the user.
5884
the initial focus.
5985

6086

61-
.. class:: SimpleDialog(master, text='', buttons=[], default=None, cancel=None, title=None, class_=None)
87+
.. class:: SimpleDialog(master, text='', buttons=[], default=None, cancel=None, title=None, class_=None, *, bitmap=None, detail='', use_ttk=True)
6288

6389
A simple modal dialog that displays the message *text* above a row of push
64-
buttons whose labels are given by *buttons*, and returns the index of the
65-
button the user presses.
66-
*default* is the index of the button activated by the Return key, *cancel*
67-
the index returned when the window is closed through the window manager,
68-
*title* the window title, and *class_* the Tk class name of the window.
90+
buttons given by *buttons*, and returns the index of the button the user
91+
presses.
92+
Each entry of *buttons* is either a button label, or a mapping of button
93+
options such as ``{'text': 'OK', 'underline': 0}``; an ``underline`` option
94+
makes :kbd:`Alt` plus the underlined character invoke the button.
95+
*default* is the index of the default button, activated by the Return key
96+
when no button has the focus, *cancel* the index returned when the window is
97+
closed through the window manager, *title* the window title, and *class_*
98+
the Tk class name of the window.
99+
*bitmap* is the name of a bitmap displayed beside the message
100+
(for example ``'warning'`` or ``'question'``); the standard names
101+
``'error'``, ``'info'``, ``'question'`` and ``'warning'`` are shown as
102+
themed icons when *use_ttk* is true.
103+
*detail* is a secondary message displayed below *text*.
104+
When *use_ttk* is true (the default), the dialog is built from the themed
105+
:mod:`tkinter.ttk` widgets, modelled on the Tk message box; when false, from
106+
the classic :mod:`tkinter` widgets, modelled on ``tk_dialog``.
107+
108+
.. versionchanged:: next
109+
The dialog is now built from the themed :mod:`tkinter.ttk` widgets by
110+
default, instead of the classic :mod:`tkinter` widgets.
111+
Added the *bitmap*, *detail* and *use_ttk* parameters.
112+
Entries of *buttons* may be mappings of button options.
69113

70114
.. method:: go()
71115

Doc/library/queue.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ provide the public methods described below.
173173

174174
.. method:: Queue.get_nowait()
175175

176-
Equivalent to ``get(False)``.
176+
Equivalent to ``get(block=False)``.
177177

178178
Two methods are offered to support tracking whether enqueued tasks have been
179179
fully processed by daemon consumer threads.

0 commit comments

Comments
 (0)