Skip to content

Commit ad5b090

Browse files
Merge branch 'main' into pep646-typing
2 parents 9835938 + c4d2d57 commit ad5b090

File tree

367 files changed

+8013
-5092
lines changed

Some content is hidden

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

367 files changed

+8013
-5092
lines changed

.azure-pipelines/tcltk-build.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,12 @@ jobs:
6060
& "$(msbuild)" PCbuild\tix.vcxproj "@msbuild.rsp" /p:Platform=x64 /p:tcltkDir="$(OutDir)\amd64"
6161
displayName: 'Build for amd64'
6262
63+
- powershell: |
64+
& "$(msbuild)" PCbuild\tcl.vcxproj "@msbuild.rsp" /p:Platform=ARM64 /p:tcltkDir="$(OutDir)\arm64"
65+
& "$(msbuild)" PCbuild\tk.vcxproj "@msbuild.rsp" /p:Platform=ARM64 /p:tcltkDir="$(OutDir)\arm64"
66+
& "$(msbuild)" PCbuild\tix.vcxproj "@msbuild.rsp" /p:Platform=ARM64 /p:tcltkDir="$(OutDir)\arm64"
67+
displayName: 'Build for arm64'
68+
6369
- publish: '$(OutDir)'
6470
artifact: 'tcltk'
6571
displayName: 'Publishing tcltk'

.azure-pipelines/windows-release/msi-steps.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,13 @@ steps:
7171
artifactName: tcltk_lib_amd64
7272
targetPath: $(Build.BinariesDirectory)\tcltk_lib_amd64
7373

74+
- task: DownloadPipelineArtifact@1
75+
displayName: 'Download artifact: tcltk_lib_arm64'
76+
condition: and(succeeded(), eq(variables['PublishARM64'], 'true'))
77+
inputs:
78+
artifactName: tcltk_lib_arm64
79+
targetPath: $(Build.BinariesDirectory)\tcltk_lib_arm64
80+
7481
- powershell: |
7582
copy $(Build.BinariesDirectory)\amd64\Activate.ps1 Lib\venv\scripts\common\Activate.ps1 -Force
7683
displayName: 'Copy signed files into sources'
@@ -107,7 +114,6 @@ steps:
107114
PYTHONHOME: $(Build.SourcesDirectory)
108115
TclTkLibraryDir: $(Build.BinariesDirectory)\tcltk_lib_win32
109116
BuildForRelease: true
110-
SuppressMinGWLib: true
111117
112118
- script: |
113119
%MSBUILD% Tools\msi\bundle\releaselocal.wixproj /t:Rebuild /p:RebuildAll=true
@@ -120,7 +126,6 @@ steps:
120126
PYTHONHOME: $(Build.SourcesDirectory)
121127
TclTkLibraryDir: $(Build.BinariesDirectory)\tcltk_lib_amd64
122128
BuildForRelease: true
123-
SuppressMinGWLib: true
124129
125130
- script: |
126131
%MSBUILD% Tools\msi\bundle\releaselocal.wixproj /t:Rebuild /p:RebuildAll=true
@@ -132,8 +137,8 @@ steps:
132137
PYTHON: $(Build.BinariesDirectory)\win32\python.exe
133138
PythonForBuild: $(Build.BinariesDirectory)\win32\python.exe
134139
PYTHONHOME: $(Build.SourcesDirectory)
140+
TclTkLibraryDir: $(Build.BinariesDirectory)\tcltk_lib_arm64
135141
BuildForRelease: true
136-
SuppressMinGWLib: true
137142
138143
- task: CopyFiles@2
139144
displayName: 'Assemble artifact: msi (win32)'

.azure-pipelines/windows-release/stage-build.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,13 @@ jobs:
166166
platform: x64
167167
msbuildArguments: /t:CopyTclTkLib /p:OutDir="$(Build.ArtifactStagingDirectory)\tcl_amd64"
168168

169+
- task: MSBuild@1
170+
displayName: 'Copy Tcl/Tk lib for publish'
171+
inputs:
172+
solution: PCbuild\tcltk.props
173+
platform: ARM64
174+
msbuildArguments: /t:CopyTclTkLib /p:OutDir="$(Build.ArtifactStagingDirectory)\tcl_arm64"
175+
169176
- task: PublishPipelineArtifact@0
170177
displayName: 'Publish artifact: tcltk_lib_win32'
171178
inputs:
@@ -177,3 +184,9 @@ jobs:
177184
inputs:
178185
targetPath: '$(Build.ArtifactStagingDirectory)\tcl_amd64'
179186
artifactName: tcltk_lib_amd64
187+
188+
- task: PublishPipelineArtifact@0
189+
displayName: 'Publish artifact: tcltk_lib_arm64'
190+
inputs:
191+
targetPath: '$(Build.ArtifactStagingDirectory)\tcl_arm64'
192+
artifactName: tcltk_lib_arm64

.azure-pipelines/windows-release/stage-layout-full.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ jobs:
2626
HostArch: amd64
2727
Python: $(Build.BinariesDirectory)\bin_amd64\python.exe
2828
PYTHONHOME: $(Build.SourcesDirectory)
29+
TclLibrary: $(Build.BinariesDirectory)\tcltk_lib\tcl8
2930

3031
steps:
3132
- template: ./checkout.yml

.azure-pipelines/windows-release/stage-layout-msix.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ jobs:
2525
HostArch: amd64
2626
Python: $(Build.BinariesDirectory)\bin_amd64\python.exe
2727
PYTHONHOME: $(Build.SourcesDirectory)
28+
TclLibrary: $(Build.BinariesDirectory)\tcltk_lib\tcl8
2829

2930
steps:
3031
- template: ./checkout.yml

.github/CODEOWNERS

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ Objects/call.c @markshannon
2020
Python/ceval.c @markshannon
2121
Python/compile.c @markshannon
2222
Python/ast_opt.c @isidentical
23+
Lib/test/test_patma.py @brandtbucher
24+
Lib/test/test_peepholer.py @brandtbucher
2325

2426
# Exceptions
2527
Lib/traceback.py @iritkatriel
@@ -136,7 +138,7 @@ Lib/ast.py @isidentical
136138

137139
**/*idlelib* @terryjreedy
138140

139-
**/*typing* @gvanrossum @Fidget-Spinner
141+
**/*typing* @gvanrossum @Fidget-Spinner @JelleZijlstra
140142

141143
**/*asyncore @giampaolo
142144
**/*asynchat @giampaolo

.github/workflows/build.yml

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,6 @@ jobs:
100100
run: make smelly
101101
- name: Check limited ABI symbols
102102
run: make check-limited-abi
103-
- name: Check global objects
104-
run: make check-global-objects
105103

106104
build_win32:
107105
name: 'Windows (x86)'
@@ -308,12 +306,4 @@ jobs:
308306
- name: Display build info
309307
run: make pythoninfo
310308
- name: Tests
311-
# Skip test_tools test_peg_generator test_concurrent_futures because
312-
# there are too slow: between 5 and 20 minutes on this CI.
313-
#
314-
# Skip multiprocessing and concurrent.futures tests which are affected by
315-
# bpo-45200 bug: libasan dead lock in pthread_create().
316-
#
317-
# test___all__ is skipped because importing some modules directly can trigger
318-
# known problems with ASAN (like tk or crypt).
319-
run: xvfb-run make buildbottest TESTOPTS="-j4 -uall,-cpu -x test___all__ test_multiprocessing_fork test_multiprocessing_forkserver test_multiprocessing_spawn test_tools test_peg_generator test_concurrent_futures"
309+
run: xvfb-run make buildbottest TESTOPTS="-j4 -uall,-cpu"

.github/workflows/doc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848
- name: 'Build HTML documentation'
4949
run: make -C Doc/ PYTHON=../python SPHINXOPTS="-q -W --keep-going -j4" html
5050
- name: 'Upload'
51-
uses: actions/upload-artifact@v2.2.4
51+
uses: actions/upload-artifact@v2.3.1
5252
with:
5353
name: doc-html
5454
path: Doc/build/html

.github/workflows/stale.yml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,27 @@ jobs:
1414
runs-on: ubuntu-latest
1515

1616
steps:
17-
- uses: actions/stale@v4
17+
- name: "Check PRs with 'CLA signed' label"
18+
uses: actions/stale@v4
1819
with:
1920
repo-token: ${{ secrets.GITHUB_TOKEN }}
21+
only-pr-labels: 'CLA signed'
2022
stale-pr-message: 'This PR is stale because it has been open for 30 days with no activity.'
2123
stale-pr-label: 'stale'
2224
days-before-stale: 30
2325
days-before-close: -1
26+
ascending: true
27+
operations-per-run: 120
28+
29+
- name: "Check PRs with 'CLA not signed' label"
30+
uses: actions/stale@v4
31+
with:
32+
repo-token: ${{ secrets.GITHUB_TOKEN }}
33+
only-pr-labels: 'CLA not signed'
34+
stale-pr-message: 'This PR is stale because it has been open for 30 days with no activity. If the CLA is not signed within 14 days, it will be closed. See also https://devguide.python.org/pullrequest/#licensing'
35+
stale-pr-label: 'stale'
36+
close-pr-message: 'Closing this stale PR because the CLA is still not signed.'
37+
days-before-stale: 30
38+
days-before-close: 14
39+
ascending: true
40+
operations-per-run: 120

Doc/c-api/exceptions.rst

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,14 @@ For convenience, some of these functions will always return a
253253
.. versionadded:: 3.3
254254
255255
256+
.. c:function:: PyObject* PyErr_SetImportErrorSubclass(PyObject *exception, PyObject *msg, PyObject *name, PyObject *path)
257+
258+
Much like :c:func:`PyErr_SetImportError` but this function allows for
259+
specifying a subclass of :exc:`ImportError` to raise.
260+
261+
.. versionadded:: 3.6
262+
263+
256264
.. c:function:: void PyErr_SyntaxLocationObject(PyObject *filename, int lineno, int col_offset)
257265
258266
Set file, line, and offset information for the current exception. If the
@@ -320,13 +328,6 @@ an error value).
320328
:mod:`warnings` module and the :option:`-W` option in the command line
321329
documentation. There is no C API for warning control.
322330
323-
.. c:function:: PyObject* PyErr_SetImportErrorSubclass(PyObject *exception, PyObject *msg, PyObject *name, PyObject *path)
324-
325-
Much like :c:func:`PyErr_SetImportError` but this function allows for
326-
specifying a subclass of :exc:`ImportError` to raise.
327-
328-
.. versionadded:: 3.6
329-
330331
331332
.. c:function:: int PyErr_WarnExplicitObject(PyObject *category, PyObject *message, PyObject *filename, int lineno, PyObject *module, PyObject *registry)
332333

Doc/c-api/reflection.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Reflection
3131
See also :c:func:`PyThreadState_GetFrame`.
3232
3333
34-
.. c:function:: int PyFrame_GetBack(PyFrameObject *frame)
34+
.. c:function:: PyFrameObject* PyFrame_GetBack(PyFrameObject *frame)
3535
3636
Get the *frame* next outer frame.
3737
@@ -42,7 +42,7 @@ Reflection
4242
.. versionadded:: 3.9
4343
4444
45-
.. c:function:: int PyFrame_GetCode(PyFrameObject *frame)
45+
.. c:function:: PyCodeObject* PyFrame_GetCode(PyFrameObject *frame)
4646
4747
Get the *frame* code.
4848

Doc/c-api/typeobj.rst

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,7 @@ PyObject Slots
476476
--------------
477477

478478
The type object structure extends the :c:type:`PyVarObject` structure. The
479-
:attr:`ob_size` field is used for dynamic types (created by :func:`type_new`,
479+
:attr:`ob_size` field is used for dynamic types (created by :func:`type_new`,
480480
usually called from a class statement). Note that :c:data:`PyType_Type` (the
481481
metatype) initializes :c:member:`~PyTypeObject.tp_itemsize`, which means that its instances (i.e.
482482
type objects) *must* have the :attr:`ob_size` field.
@@ -1233,7 +1233,7 @@ and :c:type:`PyType_Type` effectively act as defaults.)
12331233
.. note::
12341234

12351235
:const:`Py_TPFLAGS_MAPPING` and :const:`Py_TPFLAGS_SEQUENCE` are
1236-
mutually exclusive; it is an error enable both flags simultaneously.
1236+
mutually exclusive; it is an error to enable both flags simultaneously.
12371237

12381238
**Inheritance:**
12391239

@@ -1255,7 +1255,7 @@ and :c:type:`PyType_Type` effectively act as defaults.)
12551255
.. note::
12561256

12571257
:const:`Py_TPFLAGS_MAPPING` and :const:`Py_TPFLAGS_SEQUENCE` are
1258-
mutually exclusive; it is an error enable both flags simultaneously.
1258+
mutually exclusive; it is an error to enable both flags simultaneously.
12591259

12601260
**Inheritance:**
12611261

@@ -2000,6 +2000,17 @@ and :c:type:`PyType_Type` effectively act as defaults.)
20002000
For this field to be taken into account (even through inheritance),
20012001
you must also set the :const:`Py_TPFLAGS_HAVE_FINALIZE` flags bit.
20022002

2003+
Also, note that, in a garbage collected Python,
2004+
:c:member:`~PyTypeObject.tp_dealloc` may be called from
2005+
any Python thread, not just the thread which created the object (if the object
2006+
becomes part of a refcount cycle, that cycle might be collected by a garbage
2007+
collection on any thread). This is not a problem for Python API calls, since
2008+
the thread on which tp_dealloc is called will own the Global Interpreter Lock
2009+
(GIL). However, if the object being destroyed in turn destroys objects from some
2010+
other C or C++ library, care should be taken to ensure that destroying those
2011+
objects on the thread which called tp_dealloc will not violate any assumptions
2012+
of the library.
2013+
20032014
**Inheritance:**
20042015

20052016
This field is inherited by subtypes.
@@ -2024,17 +2035,6 @@ and :c:type:`PyType_Type` effectively act as defaults.)
20242035
.. versionadded:: 3.9 (the field exists since 3.8 but it's only used since 3.9)
20252036

20262037

2027-
Also, note that, in a garbage collected Python, :c:member:`~PyTypeObject.tp_dealloc` may be called from
2028-
any Python thread, not just the thread which created the object (if the object
2029-
becomes part of a refcount cycle, that cycle might be collected by a garbage
2030-
collection on any thread). This is not a problem for Python API calls, since
2031-
the thread on which tp_dealloc is called will own the Global Interpreter Lock
2032-
(GIL). However, if the object being destroyed in turn destroys objects from some
2033-
other C or C++ library, care should be taken to ensure that destroying those
2034-
objects on the thread which called tp_dealloc will not violate any assumptions
2035-
of the library.
2036-
2037-
20382038
.. _static-types:
20392039

20402040
Static Types
@@ -2440,7 +2440,8 @@ Async Object Structures
24402440

24412441
PyObject *am_aiter(PyObject *self);
24422442

2443-
Must return an :term:`awaitable` object. See :meth:`__anext__` for details.
2443+
Must return an :term:`asynchronous iterator` object.
2444+
See :meth:`__anext__` for details.
24442445

24452446
This slot may be set to ``NULL`` if an object does not implement
24462447
asynchronous iteration protocol.

Doc/c-api/unicode.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1003,7 +1003,7 @@ Error handling is set by errors which may also be set to ``NULL`` meaning to use
10031003
the default handling defined for the codec. Default error handling for all
10041004
built-in codecs is "strict" (:exc:`ValueError` is raised).
10051005
1006-
The codecs all use a similar interface. Only deviation from the following
1006+
The codecs all use a similar interface. Only deviations from the following
10071007
generic ones are documented for simplicity.
10081008
10091009
@@ -1171,7 +1171,7 @@ These are the UTF-16 codec APIs:
11711171
``1``, any byte order mark is copied to the output (where it will result in
11721172
either a ``\ufeff`` or a ``\ufffe`` character).
11731173
1174-
After completion, *\*byteorder* is set to the current byte order at the end
1174+
After completion, ``*byteorder`` is set to the current byte order at the end
11751175
of input data.
11761176
11771177
If *byteorder* is ``NULL``, the codec starts in native order mode.
@@ -1302,7 +1302,7 @@ Character Map Codecs
13021302
13031303
This codec is special in that it can be used to implement many different codecs
13041304
(and this is in fact what was done to obtain most of the standard codecs
1305-
included in the :mod:`encodings` package). The codec uses mapping to encode and
1305+
included in the :mod:`encodings` package). The codec uses mappings to encode and
13061306
decode characters. The mapping objects provided must support the
13071307
:meth:`__getitem__` mapping interface; dictionaries and sequences work well.
13081308
@@ -1426,7 +1426,7 @@ They all return ``NULL`` or ``-1`` if an exception occurs.
14261426
.. c:function:: PyObject* PyUnicode_Splitlines(PyObject *s, int keepend)
14271427
14281428
Split a Unicode string at line breaks, returning a list of Unicode strings.
1429-
CRLF is considered to be one line break. If *keepend* is ``0``, the Line break
1429+
CRLF is considered to be one line break. If *keepend* is ``0``, the line break
14301430
characters are not included in the resulting strings.
14311431
14321432

Doc/c-api/veryhigh.rst

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@ the same library that the Python runtime is using.
7575
:c:func:`PyRun_SimpleFile`. *filename* is decoded from the filesystem
7676
encoding (:func:`sys.getfilesystemencoding`). If *filename* is ``NULL``, this
7777
function uses ``"???"`` as the filename.
78+
If *closeit* is true, the file is closed before
79+
``PyRun_SimpleFileExFlags()`` returns.
7880
7981
8082
.. c:function:: int PyRun_SimpleString(const char *command)
@@ -286,8 +288,16 @@ the same library that the Python runtime is using.
286288
287289
.. c:type:: PyFrameObject
288290
289-
The C structure of the objects used to describe frame objects. The
290-
fields of this type are subject to change at any time.
291+
The C structure of the objects used to describe frame objects.
292+
293+
The structure is only part of the internal C API: fields should not be
294+
access directly. Use getter functions like :c:func:`PyFrame_GetCode` and
295+
:c:func:`PyFrame_GetBack`.
296+
297+
Debuggers and profilers can use the limited C API to access this structure.
298+
299+
.. versionchanged:: 3.11
300+
The structure moved to the internal C API headers.
291301
292302
293303
.. c:function:: PyObject* PyEval_EvalFrame(PyFrameObject *f)

0 commit comments

Comments
 (0)