Skip to content

Commit 24a1d39

Browse files
committed
Merge remote-tracking branch 'upstream/main' into jump_or_pop
2 parents ee57145 + f6e43e8 commit 24a1d39

File tree

444 files changed

+11747
-5533
lines changed

Some content is hidden

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

444 files changed

+11747
-5533
lines changed

.azure-pipelines/windows-release/stage-publish-pythonorg.yml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ jobs:
135135
136136
- powershell: |
137137
$failures = 0
138-
gci "msi\*\*-webinstall.exe" -File | %{
138+
gci "msi\*\*.exe" -File | %{
139139
$d = mkdir "tests\$($_.BaseName)" -Force
140140
gci $d -r -File | del
141141
$ic = copy $_ $d -PassThru
@@ -155,7 +155,11 @@ jobs:
155155
displayName: 'Test layouts'
156156
157157
- powershell: |
158-
$hashes = gci doc\htmlhelp\python*.chm, msi\*\*.exe, embed\*.zip | `
158+
$files = gci -File "msi\*\*.exe", "embed\*.zip"
159+
if ("$(DoCHM)" -ieq "true") {
160+
$files = $files + (gci -File "doc\htmlhelp\python*.chm")
161+
}
162+
$hashes = $files | `
159163
Sort-Object Name | `
160164
Format-Table Name, @{
161165
Label="MD5";
@@ -170,9 +174,13 @@ jobs:
170174
171175
- powershell: |
172176
"Copying:"
173-
(gci msi\*\python*.asc, doc\htmlhelp\*.asc, embed\*.asc).FullName
177+
$files = gci -File "msi\*\python*.asc", "embed\*.asc"
178+
if ("$(DoCHM)" -ieq "true") {
179+
$files = $files + (gci -File "doc\htmlhelp\*.asc")
180+
}
181+
$files.FullName
174182
$d = mkdir "$(Build.ArtifactStagingDirectory)\hashes" -Force
175-
move msi\*\python*.asc, doc\htmlhelp\*.asc, embed\*.asc $d -Force
183+
move $files $d -Force
176184
gci msi -Directory | %{ move "msi\$_\*.asc" (mkdir "$d\$_" -Force) }
177185
workingDirectory: $(Build.BinariesDirectory)
178186
displayName: 'Copy GPG signatures for build'

.gitattributes

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,17 @@ PC/readme.txt text eol=crlf
6060

6161
**/clinic/*.c.h generated
6262
*_db.h generated
63+
Doc/data/stable_abi.dat generated
6364
Doc/library/token-list.inc generated
6465
Include/internal/pycore_ast.h generated
6566
Include/internal/pycore_ast_state.h generated
6667
Include/opcode.h generated
6768
Include/token.h generated
6869
Lib/keyword.py generated
70+
Lib/test/test_stable_abi_ctypes.py generated
6971
Lib/token.py generated
7072
Objects/typeslots.inc generated
73+
PC/python3dll.c generated
7174
Parser/parser.c generated
7275
Parser/token.c generated
7376
Programs/test_frozenmain.h generated

.github/CONTRIBUTING.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ comments they leave and their "Details" links, respectively. The key points of
4444
our workflow that are not covered by a bot or status check are:
4545

4646
- All discussions that are not directly related to the code in the pull request
47-
should happen on bugs.python.org
47+
should happen on `GitHub Issues <https://github.com/python/cpython/issues>`_.
4848
- Upon your first non-trivial pull request (which includes documentation changes),
4949
feel free to add yourself to ``Misc/ACKS``
5050

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 0 additions & 5 deletions
This file was deleted.

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ Please read this comment in its entirety. It's quite important.
77
It should be in the following format:
88
99
```
10-
bpo-NNNN: Summary of the changes made
10+
gh-NNNNN: Summary of the changes made
1111
```
1212
13-
Where: bpo-NNNN refers to the issue number in the https://bugs.python.org.
13+
Where: gh-NNNNN refers to the GitHub issue number.
1414
1515
Most PRs will require an issue number. Trivial changes, like fixing a typo, do not need an issue.
1616

.github/workflows/build.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: Tests
22

3-
# bpo-40548: "paths-ignore" is not used to skip documentation-only PRs, because
3+
# gh-84728: "paths-ignore" is not used to skip documentation-only PRs, because
44
# it prevents to mark a job as mandatory. A PR cannot be merged if a job is
55
# mandatory but not scheduled because of "paths-ignore".
66
on:
@@ -82,6 +82,9 @@ jobs:
8282
run: make regen-configure
8383
- name: Build CPython
8484
run: |
85+
# Deepfreeze will usually cause global objects to be added or removed,
86+
# so we run it before regen-global-objects gets rum (in regen-all).
87+
make regen-deepfreeze
8588
make -j4 regen-all
8689
make regen-stdlib-module-names
8790
- name: Check for changes
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: new-bugs-announce notifier
2+
3+
on:
4+
issues:
5+
types:
6+
- opened
7+
8+
jobs:
9+
notify-new-bugs-announce:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/setup-node@v2
13+
with:
14+
node-version: 14
15+
- run: npm install mailgun.js form-data
16+
- name: Send notification
17+
uses: actions/github-script@v5
18+
env:
19+
MAILGUN_API_KEY: ${{ secrets.PSF_MAILGUN_KEY }}
20+
with:
21+
script: |
22+
const Mailgun = require("mailgun.js");
23+
const formData = require('form-data');
24+
const mailgun = new Mailgun(formData);
25+
const DOMAIN = "mg.python.org";
26+
const mg = mailgun.client({username: 'api', key: process.env.MAILGUN_API_KEY});
27+
github.rest.issues.get({
28+
issue_number: context.issue.number,
29+
owner: context.repo.owner,
30+
repo: context.repo.repo,
31+
})
32+
.then(function(issue) {
33+
const payload = {
34+
author : issue.data.user.login,
35+
issue : issue.data.number,
36+
title : issue.data.title,
37+
url : issue.data.html_url,
38+
labels : issue.data.labels.map(label => { return label.name }).join(", "),
39+
assignee : issue.data.assignees.map(assignee => { return assignee.login }),
40+
body : issue.data.body
41+
};
42+
43+
const data = {
44+
from: "CPython Issues <[email protected]>",
45+
46+
subject: `[Issue ${issue.data.number}] ${issue.data.title}`,
47+
template: "new-github-issue",
48+
'o:tracking-clicks': 'no',
49+
'h:X-Mailgun-Variables': JSON.stringify(payload)
50+
};
51+
return mg.messages.create(DOMAIN, data)
52+
})
53+
.then(msg => console.log(msg));

Doc/c-api/bytearray.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,6 @@ Direct API functions
4242
Return a new bytearray object from any object, *o*, that implements the
4343
:ref:`buffer protocol <bufferobjects>`.
4444
45-
.. XXX expand about the buffer protocol, at least somewhere
46-
4745
4846
.. c:function:: PyObject* PyByteArray_FromStringAndSize(const char *string, Py_ssize_t len)
4947

Doc/c-api/bytes.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
Bytes Objects
66
-------------
77

8-
These functions raise :exc:`TypeError` when expecting a bytes parameter and are
8+
These functions raise :exc:`TypeError` when expecting a bytes parameter and
99
called with a non-bytes parameter.
1010

1111
.. index:: object: bytes

Doc/c-api/call.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ This convention is not only used by *tp_call*:
2626
:c:member:`~PyTypeObject.tp_new` and :c:member:`~PyTypeObject.tp_init`
2727
also pass arguments this way.
2828

29-
To call an object, use :c:func:`PyObject_Call` or other
29+
To call an object, use :c:func:`PyObject_Call` or another
3030
:ref:`call API <capi-call>`.
3131

3232

Doc/c-api/exceptions.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ For convenience, some of these functions will always return a
281281
282282
.. c:function:: void PyErr_SyntaxLocation(const char *filename, int lineno)
283283
284-
Like :c:func:`PyErr_SyntaxLocationEx`, but the col_offset parameter is
284+
Like :c:func:`PyErr_SyntaxLocationEx`, but the *col_offset* parameter is
285285
omitted.
286286
287287
@@ -333,7 +333,7 @@ an error value).
333333
334334
Issue a warning message with explicit control over all warning attributes. This
335335
is a straightforward wrapper around the Python function
336-
:func:`warnings.warn_explicit`, see there for more information. The *module*
336+
:func:`warnings.warn_explicit`; see there for more information. The *module*
337337
and *registry* arguments may be set to ``NULL`` to get the default effect
338338
described there.
339339
@@ -441,7 +441,7 @@ Querying the error indicator
441441
error indicator.
442442
443443
444-
.. c:function:: void PyErr_NormalizeException(PyObject**exc, PyObject**val, PyObject**tb)
444+
.. c:function:: void PyErr_NormalizeException(PyObject **exc, PyObject **val, PyObject **tb)
445445
446446
Under certain circumstances, the values returned by :c:func:`PyErr_Fetch` below
447447
can be "unnormalized", meaning that ``*exc`` is a class object but ``*val`` is

Doc/c-api/frame.rst

Lines changed: 50 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,12 @@ Frame Objects
77
88
The C structure of the objects used to describe frame objects.
99

10-
The structure is not part of the C API.
10+
There are no public members in this structure.
1111

1212
.. versionchanged:: 3.11
13-
The structure moved to the internal C API headers.
13+
The members of this structure were removed from the public C API.
14+
Refer to the :ref:`What's New entry <pyframeobject-3.11-hiding>`
15+
for details.
1416

1517
The :c:func:`PyEval_GetFrame` and :c:func:`PyThreadState_GetFrame` functions
1618
can be used to get a frame object.
@@ -30,6 +32,17 @@ See also :ref:`Reflection <reflection>`.
3032
.. versionadded:: 3.9
3133
3234
35+
.. c:function:: PyObject* PyFrame_GetBuiltins(PyFrameObject *frame)
36+
37+
Get the *frame*'s ``f_builtins`` attribute.
38+
39+
Return a :term:`strong reference`. The result cannot be ``NULL``.
40+
41+
*frame* must not be ``NULL``.
42+
43+
.. versionadded:: 3.11
44+
45+
3346
.. c:function:: PyCodeObject* PyFrame_GetCode(PyFrameObject *frame)
3447
3548
Get the *frame* code.
@@ -41,6 +54,41 @@ See also :ref:`Reflection <reflection>`.
4154
.. versionadded:: 3.9
4255
4356
57+
.. c:function:: PyObject* PyFrame_GetGenerator(PyFrameObject *frame)
58+
59+
Get the generator, coroutine, or async generator that owns this frame,
60+
or ``NULL`` if this frame is not owned by a generator.
61+
Does not raise an exception, even if the return value is ``NULL``.
62+
63+
Return a :term:`strong reference`, or ``NULL``.
64+
65+
*frame* must not be ``NULL``.
66+
67+
.. versionadded:: 3.11
68+
69+
70+
.. c:function:: PyObject* PyFrame_GetGlobals(PyFrameObject *frame)
71+
72+
Get the *frame*'s ``f_globals`` attribute.
73+
74+
Return a :term:`strong reference`. The result cannot be ``NULL``.
75+
76+
*frame* must not be ``NULL``.
77+
78+
.. versionadded:: 3.11
79+
80+
81+
.. c:function:: int PyFrame_GetLasti(PyFrameObject *frame)
82+
83+
Get the *frame*'s ``f_lasti`` attribute (:class:`dict`).
84+
85+
Returns -1 if ``frame.f_lasti`` is ``None``.
86+
87+
*frame* must not be ``NULL``.
88+
89+
.. versionadded:: 3.11
90+
91+
4492
.. c:function:: PyObject* PyFrame_GetLocals(PyFrameObject *frame)
4593
4694
Get the *frame*'s ``f_locals`` attribute (:class:`dict`).

Doc/c-api/init.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1783,7 +1783,7 @@ is not possible due to its implementation being opaque at build time.
17831783
argument is `NULL`.
17841784
17851785
.. note::
1786-
A freed key becomes a dangling pointer, you should reset the key to
1786+
A freed key becomes a dangling pointer. You should reset the key to
17871787
`NULL`.
17881788
17891789

Doc/c-api/init_config.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ There are two kinds of configuration:
1616

1717
* The :ref:`Python Configuration <init-python-config>` can be used to build a
1818
customized Python which behaves as the regular Python. For example,
19-
environments variables and command line arguments are used to configure
19+
environment variables and command line arguments are used to configure
2020
Python.
2121

2222
* The :ref:`Isolated Configuration <init-isolated-conf>` can be used to embed
2323
Python into an application. It isolates Python from the system. For example,
24-
environments variables are ignored, the LC_CTYPE locale is left unchanged and
24+
environment variables are ignored, the LC_CTYPE locale is left unchanged and
2525
no signal handler is registered.
2626

2727
The :c:func:`Py_RunMain` function can be used to write a customized Python
@@ -1316,7 +1316,7 @@ Isolated Configuration
13161316
isolate Python from the system. For example, to embed Python into an
13171317
application.
13181318
1319-
This configuration ignores global configuration variables, environments
1319+
This configuration ignores global configuration variables, environment
13201320
variables, command line arguments (:c:member:`PyConfig.argv` is not parsed)
13211321
and user site directory. The C standard streams (ex: ``stdout``) and the
13221322
LC_CTYPE locale are left unchanged. Signal handlers are not installed.
@@ -1460,7 +1460,7 @@ Multi-Phase Initialization Private Provisional API
14601460
==================================================
14611461
14621462
This section is a private provisional API introducing multi-phase
1463-
initialization, the core feature of the :pep:`432`:
1463+
initialization, the core feature of :pep:`432`:
14641464
14651465
* "Core" initialization phase, "bare minimum Python":
14661466

Doc/c-api/iter.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ There are two functions specifically for working with iterators.
1414
1515
.. c:function:: int PyAIter_Check(PyObject *o)
1616
17-
Returns non-zero if the object 'obj' provides :class:`AsyncIterator`
18-
protocols, and ``0`` otherwise. This function always succeeds.
17+
Return non-zero if the object *o* provides the :class:`AsyncIterator`
18+
protocol, and ``0`` otherwise. This function always succeeds.
1919
2020
.. versionadded:: 3.10
2121

Doc/c-api/long.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ distinguished from a number. Use :c:func:`PyErr_Occurred` to disambiguate.
4141
Return a new :c:type:`PyLongObject` object from *v*, or ``NULL`` on failure.
4242
4343
The current implementation keeps an array of integer objects for all integers
44-
between ``-5`` and ``256``, when you create an int in that range you actually
44+
between ``-5`` and ``256``. When you create an int in that range you actually
4545
just get back a reference to the existing object.
4646
4747

Doc/c-api/mapping.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ See also :c:func:`PyObject_GetItem`, :c:func:`PyObject_SetItem` and
1111

1212
.. c:function:: int PyMapping_Check(PyObject *o)
1313
14-
Return ``1`` if the object provides mapping protocol or supports slicing,
14+
Return ``1`` if the object provides the mapping protocol or supports slicing,
1515
and ``0`` otherwise. Note that it returns ``1`` for Python classes with
16-
a :meth:`__getitem__` method since in general case it is impossible to
17-
determine what type of keys it supports. This function always succeeds.
16+
a :meth:`__getitem__` method, since in general it is impossible to
17+
determine what type of keys the class supports. This function always succeeds.
1818
1919
2020
.. c:function:: Py_ssize_t PyMapping_Size(PyObject *o)

Doc/c-api/memory.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ memory from the Python heap.
306306
307307
.. note::
308308
There is no guarantee that the memory returned by these allocators can be
309-
successfully casted to a Python object when intercepting the allocating
309+
successfully cast to a Python object when intercepting the allocating
310310
functions in this domain by the methods described in
311311
the :ref:`Customize Memory Allocators <customize-memory-allocators>` section.
312312
@@ -403,7 +403,7 @@ Customize Memory Allocators
403403
.. c:type:: PyMemAllocatorEx
404404
405405
Structure used to describe a memory block allocator. The structure has
406-
four fields:
406+
the following fields:
407407
408408
+----------------------------------------------------------+---------------------------------------+
409409
| Field | Meaning |

Doc/c-api/method.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ to bind a :c:data:`PyCFunction` to a class object. It replaces the former call
2727
2828
.. c:function:: PyObject* PyInstanceMethod_New(PyObject *func)
2929
30-
Return a new instance method object, with *func* being any callable object
30+
Return a new instance method object, with *func* being any callable object.
3131
*func* is the function that will be called when the instance method is
3232
called.
3333

0 commit comments

Comments
 (0)