Skip to content

Commit df3ab57

Browse files
Merge branch 'main' into bpo-47135
2 parents 21339f1 + 5f056ac commit df3ab57

File tree

482 files changed

+12925
-5891
lines changed

Some content is hidden

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

482 files changed

+12925
-5891
lines changed

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

+12-4
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

+3
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

+1-1
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

-5
This file was deleted.

.github/PULL_REQUEST_TEMPLATE.md

+2-2
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

+1-1
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:
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));

.github/workflows/stale.yml

+1-15
Original file line numberDiff line numberDiff line change
@@ -14,27 +14,13 @@ jobs:
1414
runs-on: ubuntu-latest
1515

1616
steps:
17-
- name: "Check PRs with 'CLA signed' label"
17+
- name: "Check PRs"
1818
uses: actions/stale@v4
1919
with:
2020
repo-token: ${{ secrets.GITHUB_TOKEN }}
21-
only-pr-labels: 'CLA signed'
2221
stale-pr-message: 'This PR is stale because it has been open for 30 days with no activity.'
2322
stale-pr-label: 'stale'
2423
days-before-stale: 30
2524
days-before-close: -1
2625
ascending: true
2726
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/bugs.rst

+20-19
Original file line numberDiff line numberDiff line change
@@ -40,38 +40,39 @@ though it may take a while to be processed.
4040
Using the Python issue tracker
4141
==============================
4242

43-
Bug reports for Python itself should be submitted via the Python Bug Tracker
44-
(https://bugs.python.org/). The bug tracker offers a web form which allows
45-
pertinent information to be entered and submitted to the developers.
43+
Issue reports for Python itself should be submitted via the GitHub issues
44+
tracker (https://github.com/python/cpython/issues).
45+
The GitHub issues tracker offers a web form which allows pertinent information
46+
to be entered and submitted to the developers.
4647

4748
The first step in filing a report is to determine whether the problem has
4849
already been reported. The advantage in doing so, aside from saving the
49-
developers time, is that you learn what has been done to fix it; it may be that
50+
developers' time, is that you learn what has been done to fix it; it may be that
5051
the problem has already been fixed for the next release, or additional
5152
information is needed (in which case you are welcome to provide it if you can!).
52-
To do this, search the bug database using the search box on the top of the page.
53+
To do this, search the tracker using the search box at the top of the page.
5354

54-
If the problem you're reporting is not already in the bug tracker, go back to
55-
the Python Bug Tracker and log in. If you don't already have a tracker account,
56-
select the "Register" link or, if you use OpenID, one of the OpenID provider
57-
logos in the sidebar. It is not possible to submit a bug report anonymously.
55+
If the problem you're reporting is not already in the list, log in to GitHub.
56+
If you don't already have a GitHub account, create a new account using the
57+
"Sign up" link.
58+
It is not possible to submit a bug report anonymously.
5859

59-
Being now logged in, you can submit a bug. Select the "Create New" link in the
60-
sidebar to open the bug reporting form.
60+
Being now logged in, you can submit an issue.
61+
Click on the "New issue" button in the top bar to report a new issue.
6162

62-
The submission form has a number of fields. For the "Title" field, enter a
63-
*very* short description of the problem; less than ten words is good. In the
64-
"Type" field, select the type of your problem; also select the "Component" and
65-
"Versions" to which the bug relates.
63+
The submission form has two fields, "Title" and "Comment".
64+
65+
For the "Title" field, enter a *very* short description of the problem;
66+
less than ten words is good.
6667

6768
In the "Comment" field, describe the problem in detail, including what you
6869
expected to happen and what did happen. Be sure to include whether any
6970
extension modules were involved, and what hardware and software platform you
7071
were using (including version information as appropriate).
7172

72-
Each bug report will be assigned to a developer who will determine what needs to
73-
be done to correct the problem. You will receive an update each time action is
74-
taken on the bug.
73+
Each issue report will be reviewed by a developer who will determine what needs to
74+
be done to correct the problem. You will receive an update each time an action is
75+
taken on the issue.
7576

7677

7778
.. seealso::
@@ -95,6 +96,6 @@ patching Python in the `Python Developer's Guide`_. If you have questions,
9596
the `core-mentorship mailing list`_ is a friendly place to get answers to
9697
any and all questions pertaining to the process of fixing issues in Python.
9798

98-
.. _Documentation bugs: https://bugs.python.org/issue?@filter=status&@filter=components&components=4&status=1&@columns=id,activity,title,status&@sort=-activity
99+
.. _Documentation bugs: https://github.com/python/cpython/issues?q=is%3Aissue+is%3Aopen+label%3Adocs
99100
.. _Python Developer's Guide: https://devguide.python.org/
100101
.. _core-mentorship mailing list: https://mail.python.org/mailman3/lists/core-mentorship.python.org/

Doc/c-api/bytearray.rst

-2
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

+1-1
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

+1-1
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

+3-3
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

+15-2
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.
@@ -76,6 +78,17 @@ See also :ref:`Reflection <reflection>`.
7678
.. versionadded:: 3.11
7779
7880
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+
7992
.. c:function:: PyObject* PyFrame_GetLocals(PyFrameObject *frame)
8093
8194
Get the *frame*'s ``f_locals`` attribute (:class:`dict`).

Doc/c-api/init.rst

+1-1
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

+4-4
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

+2-2
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

+1-1
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

0 commit comments

Comments
 (0)