Skip to content

Commit ddd5304

Browse files
authored
Merge pull request #504 from python/main
Sync Fork from Upstream Repo
2 parents 861c41a + fa106a6 commit ddd5304

297 files changed

Lines changed: 12030 additions & 9474 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.

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ Doc/library/token-list.inc linguist-generated=true
5757
Include/token.h linguist-generated=true
5858
Lib/token.py linguist-generated=true
5959
Parser/token.c linguist-generated=true
60+
Programs/test_frozenmain.h linguist-generated=true
6061

6162
# Language aware diff headers
6263
# https://tekin.co.uk/2020/10/better-git-diff-output-for-ruby-python-elixir-and-more

.github/CODEOWNERS

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,11 @@ Python/ast_opt.c @isidentical
5353

5454

5555
# SSL
56-
**/*ssl* @python/crypto-team @tiran
57-
**/*.pem @python/crypto-team @tiran
56+
**/*ssl* @python/crypto-team
57+
**/*.pem @python/crypto-team
5858

5959
# CSPRNG
60-
Python/bootstrap_hash.c @python/crypto-team @tiran
60+
Python/bootstrap_hash.c @python/crypto-team
6161

6262
# Dates and times
6363
**/*datetime* @pganssle @abalkin

.github/SECURITY.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,8 @@ https://devguide.python.org/#status-of-python-branches
1010
## Reporting a Vulnerability
1111

1212
Please read the guidelines on reporting security issues [on the
13-
official website](
14-
https://www.python.org/news/security/#reporting-security-issues-in-python
15-
) for instructions on how to report a security-related problem to
13+
official website](https://www.python.org/dev/security/) for
14+
instructions on how to report a security-related problem to
1615
the Python team responsibly.
1716

1817
To reach the response team, email `security at python dot org`.

.github/workflows/build.yml

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,18 @@ name: Tests
66
on:
77
push:
88
branches:
9-
- main
10-
- 3.9
11-
- 3.8
12-
- 3.7
9+
- 'main'
10+
- '3.10'
11+
- '3.9'
12+
- '3.8'
13+
- '3.7'
1314
pull_request:
1415
branches:
15-
- main
16-
- 3.9
17-
- 3.8
18-
- 3.7
16+
- 'main'
17+
- '3.10'
18+
- '3.9'
19+
- '3.8'
20+
- '3.7'
1921

2022
jobs:
2123
check_source:
@@ -148,7 +150,7 @@ jobs:
148150
echo "LD_LIBRARY_PATH=${GITHUB_WORKSPACE}/multissl/openssl/${OPENSSL_VER}/lib" >> $GITHUB_ENV
149151
- name: 'Restore OpenSSL build'
150152
id: cache-openssl
151-
uses: actions/cache@v2.1.5
153+
uses: actions/cache@v2.1.6
152154
with:
153155
path: ./multissl/openssl/${{ env.OPENSSL_VER }}
154156
key: ${{ runner.os }}-multissl-openssl-${{ env.OPENSSL_VER }}
@@ -177,7 +179,7 @@ jobs:
177179
strategy:
178180
fail-fast: false
179181
matrix:
180-
openssl_ver: [1.1.1k, 3.0.0-alpha16]
182+
openssl_ver: [1.1.1k, 3.0.0-alpha17]
181183
env:
182184
OPENSSL_VER: ${{ matrix.openssl_ver }}
183185
MULTISSL_DIR: ${{ github.workspace }}/multissl
@@ -196,7 +198,7 @@ jobs:
196198
echo "LD_LIBRARY_PATH=${GITHUB_WORKSPACE}/multissl/openssl/${OPENSSL_VER}/lib" >> $GITHUB_ENV
197199
- name: 'Restore OpenSSL build'
198200
id: cache-openssl
199-
uses: actions/cache@v2.1.5
201+
uses: actions/cache@v2.1.6
200202
with:
201203
path: ./multissl/openssl/${{ env.OPENSSL_VER }}
202204
key: ${{ runner.os }}-multissl-openssl-${{ env.OPENSSL_VER }}

.github/workflows/build_msi.yml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,20 @@ name: TestsMSI
33
on:
44
push:
55
branches:
6-
- main
7-
- 3.9
8-
- 3.8
9-
- 3.7
6+
- 'main'
7+
- '3.10'
8+
- '3.9'
9+
- '3.8'
10+
- '3.7'
1011
paths:
1112
- 'Tools/msi/**'
1213
pull_request:
1314
branches:
14-
- main
15-
- 3.9
16-
- 3.8
17-
- 3.7
15+
- 'main'
16+
- '3.10'
17+
- '3.9'
18+
- '3.8'
19+
- '3.7'
1820
paths:
1921
- 'Tools/msi/**'
2022

.github/workflows/doc.yml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,20 @@ name: Docs
33
on:
44
#push:
55
# branches:
6-
# - main
7-
# - 3.9
8-
# - 3.8
9-
# - 3.7
6+
# - 'main'
7+
# - '3.10'
8+
# - '3.9'
9+
# - '3.8'
10+
# - '3.7'
1011
# paths:
1112
# - 'Doc/**'
1213
pull_request:
1314
branches:
14-
- main
15-
- 3.9
16-
- 3.8
17-
- 3.7
15+
- 'main'
16+
- '3.10'
17+
- '3.9'
18+
- '3.8'
19+
- '3.7'
1820
paths:
1921
- 'Doc/**'
2022
- 'Misc/**'

Doc/about.rst

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,8 @@ Many thanks go to:
2323
and writer of much of the content;
2424
* the `Docutils <http://docutils.sourceforge.net/>`_ project for creating
2525
reStructuredText and the Docutils suite;
26-
* Fredrik Lundh for his `Alternative Python Reference
27-
<http://effbot.org/zone/pyref.htm>`_ project from which Sphinx got many good
28-
ideas.
26+
* Fredrik Lundh for his Alternative Python Reference project from which Sphinx
27+
got many good ideas.
2928

3029

3130
Contributors to the Python Documentation

Doc/c-api/gcsupport.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,18 @@ Constructors for container types must conform to two rules:
3333
#. Once all the fields which may contain references to other containers are
3434
initialized, it must call :c:func:`PyObject_GC_Track`.
3535

36+
.. warning::
37+
If a type adds the Py_TPFLAGS_HAVE_GC, then it *must* implement at least
38+
a :c:member:`~PyTypeObject.tp_traverse` handler or explicitly use one
39+
from its subclass or subclasses.
40+
41+
When calling :c:func:`PyType_Ready` or some of the APIs that indirectly
42+
call it like :c:func:`PyType_FromSpecWithBases` or
43+
:c:func:`PyType_FromSpec` the interpreter will automatically populate the
44+
:c:member:`~PyTypeObject.tp_flags`, :c:member:`~PyTypeObject.tp_traverse`
45+
and :c:member:`~PyTypeObject.tp_clear` fields if the type inherits from a
46+
class that implements the garbage collector protocol and the child class
47+
does *not* include the :const:`Py_TPFLAGS_HAVE_GC` flag.
3648

3749
.. c:function:: TYPE* PyObject_GC_New(TYPE, PyTypeObject *type)
3850

Doc/c-api/structures.rst

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,10 @@ the definition of all other Python objects.
9999
100100
Return a :term:`borrowed reference`.
101101
102-
The :c:func:`Py_SET_TYPE` function must be used to set an object type.
102+
Use the :c:func:`Py_SET_TYPE` function to set an object type.
103+
104+
.. versionchanged:: 3.11
105+
:c:func:`Py_TYPE()` is changed to an inline static function.
103106
104107
105108
.. c:function:: int Py_IS_TYPE(PyObject *o, PyTypeObject *type)
@@ -121,9 +124,10 @@ the definition of all other Python objects.
121124
122125
Get the reference count of the Python object *o*.
123126
127+
Use the :c:func:`Py_SET_REFCNT()` function to set an object reference count.
128+
124129
.. versionchanged:: 3.10
125130
:c:func:`Py_REFCNT()` is changed to the inline static function.
126-
Use :c:func:`Py_SET_REFCNT()` to set an object reference count.
127131
128132
129133
.. c:function:: void Py_SET_REFCNT(PyObject *o, Py_ssize_t refcnt)
@@ -137,7 +141,10 @@ the definition of all other Python objects.
137141
138142
Get the size of the Python object *o*.
139143
140-
The :c:func:`Py_SET_SIZE` function must be used to set an object size.
144+
Use the :c:func:`Py_SET_SIZE` function to set an object size.
145+
146+
.. versionchanged:: 3.11
147+
:c:func:`Py_SIZE()` is changed to an inline static function.
141148
142149
143150
.. c:function:: void Py_SET_SIZE(PyVarObject *o, Py_ssize_t size)

Doc/c-api/type.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,15 @@ Type Objects
9797
from a type's base class. Return ``0`` on success, or return ``-1`` and sets an
9898
exception on error.
9999
100+
.. note::
101+
If some of the base classes implements the GC protocol and the provided
102+
type does not include the :const:`Py_TPFLAGS_HAVE_GC` in its flags, then
103+
the GC protocol will be automatically implemented from its parents. On
104+
the contrary, if the type being created does include
105+
:const:`Py_TPFLAGS_HAVE_GC` in its flags then it **must** implement the
106+
GC protocol itself by at least implementing the
107+
:c:member:`~PyTypeObject.tp_traverse` handle.
108+
100109
.. c:function:: void* PyType_GetSlot(PyTypeObject *type, int slot)
101110
102111
Return the function pointer stored in the given slot. If the

0 commit comments

Comments
 (0)