Skip to content

Commit f840480

Browse files
Merge branch 'python:main' into fix-issue-using-ipmodule
2 parents 7831ddc + ef25feb commit f840480

File tree

462 files changed

+24157
-12940
lines changed

Some content is hidden

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

462 files changed

+24157
-12940
lines changed

.devcontainer/Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ ENV WASMTIME_HOME=/opt/wasmtime
99
ENV WASMTIME_VERSION=7.0.0
1010
ENV WASMTIME_CPU_ARCH=x86_64
1111

12-
RUN dnf -y --nodocs install git clang xz python3-blurb dnf-plugins-core && \
13-
dnf -y --nodocs builddep python3 && \
12+
RUN dnf -y --nodocs --setopt=install_weak_deps=False install /usr/bin/{blurb,clang,curl,git,ln,tar,xz} 'dnf-command(builddep)' && \
13+
dnf -y --nodocs --setopt=install_weak_deps=False builddep python3 && \
1414
dnf -y clean all
1515

1616
RUN mkdir ${WASI_SDK_PATH} && \

.gitattributes

+4
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ Lib/test/test_importlib/resources/data01/* noeol
3232
Lib/test/test_importlib/resources/namespacedata01/* noeol
3333
Lib/test/xmltestdata/* noeol
3434

35+
# Shell scripts should have LF even on Windows because of Cygwin
36+
Lib/venv/scripts/common/activate text eol=lf
37+
Lib/venv/scripts/posix/* text eol=lf
38+
3539
# CRLF files
3640
[attr]dos text eol=crlf
3741

.github/CODEOWNERS

+2-6
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# https://git-scm.com/docs/gitignore#_pattern_format
66

77
# GitHub
8-
.github/** @ezio-melotti
8+
.github/** @ezio-melotti @hugovk
99

1010
# Build system
1111
configure* @erlend-aasland @corona10
@@ -61,11 +61,7 @@ Python/traceback.c @iritkatriel
6161
/Tools/build/parse_html5_entities.py @ezio-melotti
6262

6363
# Import (including importlib).
64-
# Ignoring importlib.h so as to not get flagged on
65-
# all pull requests that change the emitted
66-
# bytecode.
67-
**/*import*.c @brettcannon @encukou @ericsnowcurrently @ncoghlan @warsaw
68-
**/*import*.py @brettcannon @encukou @ericsnowcurrently @ncoghlan @warsaw
64+
**/*import* @brettcannon @encukou @ericsnowcurrently @ncoghlan @warsaw
6965
**/*importlib/resources/* @jaraco @warsaw @FFY00
7066
**/importlib/metadata/* @jaraco @warsaw
7167

.github/workflows/build.yml

+12-2
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ jobs:
3333
check_source:
3434
name: 'Check for source changes'
3535
runs-on: ubuntu-latest
36+
timeout-minutes: 10
3637
outputs:
3738
run_tests: ${{ steps.check.outputs.run_tests }}
3839
steps:
@@ -63,6 +64,7 @@ jobs:
6364
check_generated_files:
6465
name: 'Check if generated files are up to date'
6566
runs-on: ubuntu-latest
67+
timeout-minutes: 60
6668
needs: check_source
6769
if: needs.check_source.outputs.run_tests == 'true'
6870
steps:
@@ -118,6 +120,7 @@ jobs:
118120
build_win32:
119121
name: 'Windows (x86)'
120122
runs-on: windows-latest
123+
timeout-minutes: 60
121124
needs: check_source
122125
if: needs.check_source.outputs.run_tests == 'true'
123126
env:
@@ -126,7 +129,6 @@ jobs:
126129
- uses: actions/checkout@v3
127130
- name: Build CPython
128131
run: .\PCbuild\build.bat -e -d -p Win32
129-
timeout-minutes: 30
130132
- name: Display build info
131133
run: .\python.bat -m test.pythoninfo
132134
- name: Tests
@@ -135,6 +137,7 @@ jobs:
135137
build_win_amd64:
136138
name: 'Windows (x64)'
137139
runs-on: windows-latest
140+
timeout-minutes: 60
138141
needs: check_source
139142
if: needs.check_source.outputs.run_tests == 'true'
140143
env:
@@ -145,7 +148,6 @@ jobs:
145148
run: echo "::add-matcher::.github/problem-matchers/msvc.json"
146149
- name: Build CPython
147150
run: .\PCbuild\build.bat -e -d -p x64
148-
timeout-minutes: 30
149151
- name: Display build info
150152
run: .\python.bat -m test.pythoninfo
151153
- name: Tests
@@ -154,6 +156,7 @@ jobs:
154156
build_macos:
155157
name: 'macOS'
156158
runs-on: macos-latest
159+
timeout-minutes: 60
157160
needs: check_source
158161
if: needs.check_source.outputs.run_tests == 'true'
159162
env:
@@ -184,6 +187,7 @@ jobs:
184187
build_ubuntu:
185188
name: 'Ubuntu'
186189
runs-on: ubuntu-20.04
190+
timeout-minutes: 60
187191
needs: check_source
188192
if: needs.check_source.outputs.run_tests == 'true'
189193
env:
@@ -241,6 +245,7 @@ jobs:
241245
build_ubuntu_ssltests:
242246
name: 'Ubuntu SSL tests with OpenSSL'
243247
runs-on: ubuntu-20.04
248+
timeout-minutes: 60
244249
needs: check_source
245250
if: needs.check_source.outputs.run_tests == 'true'
246251
strategy:
@@ -290,6 +295,7 @@ jobs:
290295
build_asan:
291296
name: 'Address sanitizer'
292297
runs-on: ubuntu-20.04
298+
timeout-minutes: 60
293299
needs: check_source
294300
if: needs.check_source.outputs.run_tests == 'true'
295301
env:
@@ -302,6 +308,10 @@ jobs:
302308
run: echo "::add-matcher::.github/problem-matchers/gcc.json"
303309
- name: Install Dependencies
304310
run: sudo ./.github/workflows/posix-deps-apt.sh
311+
- name: Set up GCC-10 for ASAN
312+
uses: egor-tensin/setup-gcc@v1
313+
with:
314+
version: 10
305315
- name: Configure OpenSSL env vars
306316
run: |
307317
echo "MULTISSL_DIR=${GITHUB_WORKSPACE}/multissl" >> $GITHUB_ENV

.github/workflows/build_msi.yml

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ jobs:
2626
build:
2727
name: Windows Installer
2828
runs-on: windows-latest
29+
timeout-minutes: 60
2930
strategy:
3031
matrix:
3132
type: [x86, x64, arm64]

.github/workflows/doc.yml

+2
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ jobs:
3636
build_doc:
3737
name: 'Docs'
3838
runs-on: ubuntu-latest
39+
timeout-minutes: 60
3940
steps:
4041
- uses: actions/checkout@v3
4142
- name: Register Sphinx problem matcher
@@ -80,6 +81,7 @@ jobs:
8081
doctest:
8182
name: 'Doctest'
8283
runs-on: ubuntu-latest
84+
timeout-minutes: 60
8385
steps:
8486
- uses: actions/checkout@v3
8587
- name: Register Sphinx problem matcher

.github/workflows/new-bugs-announce-notifier.yml

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ permissions:
1111
jobs:
1212
notify-new-bugs-announce:
1313
runs-on: ubuntu-latest
14+
timeout-minutes: 10
1415
steps:
1516
- uses: actions/setup-node@v3
1617
with:

.github/workflows/project-updater.yml

+2-3
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,15 @@ jobs:
1313
add-to-project:
1414
name: Add issues to projects
1515
runs-on: ubuntu-latest
16+
timeout-minutes: 10
1617
strategy:
1718
matrix:
1819
include:
1920
# if an issue has any of these labels, it will be added
2021
# to the corresponding project
2122
- { project: 2, label: "release-blocker, deferred-blocker" }
22-
- { project: 3, label: expert-subinterpreters }
23-
- { project: 29, label: expert-asyncio }
2423
- { project: 32, label: sprint }
25-
24+
2625
steps:
2726
- uses: actions/add-to-project@v0.1.0
2827
with:
+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Check labels
2+
3+
on:
4+
pull_request:
5+
types: [opened, reopened, labeled, unlabeled, synchronize]
6+
7+
jobs:
8+
label:
9+
name: DO-NOT-MERGE / unresolved review
10+
runs-on: ubuntu-latest
11+
timeout-minutes: 10
12+
13+
steps:
14+
- uses: mheap/github-action-required-labels@v4
15+
with:
16+
mode: exactly
17+
count: 0
18+
labels: "DO-NOT-MERGE, awaiting changes, awaiting change review"

.github/workflows/stale.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,11 @@ jobs:
1212
if: github.repository_owner == 'python'
1313

1414
runs-on: ubuntu-latest
15+
timeout-minutes: 10
1516

1617
steps:
1718
- name: "Check PRs"
18-
uses: actions/stale@v7
19+
uses: actions/stale@v8
1920
with:
2021
repo-token: ${{ secrets.GITHUB_TOKEN }}
2122
stale-pr-message: 'This PR is stale because it has been open for 30 days with no activity.'

.github/workflows/verify-ensurepip-wheels.yml

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Verify bundled pip and setuptools
1+
name: Verify bundled wheels
22

33
on:
44
workflow_dispatch:
@@ -23,10 +23,11 @@ concurrency:
2323
jobs:
2424
verify:
2525
runs-on: ubuntu-latest
26+
timeout-minutes: 10
2627
steps:
2728
- uses: actions/checkout@v3
2829
- uses: actions/setup-python@v4
2930
with:
3031
python-version: '3'
31-
- name: Compare checksums of bundled pip and setuptools to ones published on PyPI
32+
- name: Compare checksum of bundled wheels to the ones published on PyPI
3233
run: ./Tools/build/verify_ensurepip_wheels.py

Doc/c-api/type.rst

+9
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,15 @@ Type Objects
232232
233233
.. versionadded:: 3.11
234234
235+
.. c:function:: int PyUnstable_Type_AssignVersionTag(PyTypeObject *type)
236+
237+
Attempt to assign a version tag to the given type.
238+
239+
Returns 1 if the type already had a valid version tag or a new one was
240+
assigned, or 0 if a new tag could not be assigned.
241+
242+
.. versionadded:: 3.12
243+
235244
236245
Creating Heap-Allocated Types
237246
.............................

Doc/conf.py

+35-3
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,21 @@
6868
# Minimum version of sphinx required
6969
needs_sphinx = '3.2'
7070

71+
# Ignore any .rst files in the includes/ directory;
72+
# they're embedded in pages but not rendered individually.
7173
# Ignore any .rst files in the venv/ directory.
72-
exclude_patterns = ['venv/*', 'README.rst']
74+
exclude_patterns = ['includes/*.rst', 'venv/*', 'README.rst']
7375
venvdir = os.getenv('VENVDIR')
7476
if venvdir is not None:
7577
exclude_patterns.append(venvdir + '/*')
7678

79+
nitpick_ignore = [
80+
# Do not error nit-picky mode builds when _SubParsersAction.add_parser cannot
81+
# be resolved, as the method is currently undocumented. For context, see
82+
# https://github.com/python/cpython/pull/103289.
83+
('py:meth', '_SubParsersAction.add_parser'),
84+
]
85+
7786
# Disable Docutils smartquotes for several translations
7887
smartquotes_excludes = {
7988
'languages': ['ja', 'fr', 'zh_TW', 'zh_CN'], 'builders': ['man', 'text'],
@@ -252,8 +261,31 @@
252261
# Options for the link checker
253262
# ----------------------------
254263

255-
# Ignore certain URLs.
256-
linkcheck_ignore = [r'https://bugs.python.org/(issue)?\d+']
264+
linkcheck_allowed_redirects = {
265+
# bpo-NNNN -> BPO -> GH Issues
266+
r'https://bugs.python.org/issue\?@action=redirect&bpo=\d+': 'https://github.com/python/cpython/issues/\d+',
267+
# GH-NNNN used to refer to pull requests
268+
r'https://github.com/python/cpython/issues/\d+': 'https://github.com/python/cpython/pull/\d+',
269+
# :source:`something` linking files in the repository
270+
r'https://github.com/python/cpython/tree/.*': 'https://github.com/python/cpython/blob/.*'
271+
}
272+
273+
linkcheck_anchors_ignore = [
274+
# ignore anchors that start with a '/', e.g. Wikipedia media files:
275+
# https://en.wikipedia.org/wiki/Walrus#/media/File:Pacific_Walrus_-_Bull_(8247646168).jpg
276+
r'\/.*',
277+
]
278+
279+
linkcheck_ignore = [
280+
# The crawler gets "Anchor not found"
281+
r'https://developer.apple.com/documentation/.+?#.*',
282+
r'https://devguide.python.org.+?/#.*',
283+
r'https://github.com.+?#.*',
284+
# Robot crawlers not allowed: "403 Client Error: Forbidden"
285+
r'https://support.enthought.com/hc/.*',
286+
# SSLError CertificateError, even though it is valid
287+
r'https://unix.org/version2/whatsnew/lp64_wp.html',
288+
]
257289

258290

259291
# Options for extensions

Doc/distributing/index.rst

+4-8
Original file line numberDiff line numberDiff line change
@@ -129,14 +129,10 @@ involved in creating and publishing a project:
129129
* `Uploading the project to the Python Package Index`_
130130
* `The .pypirc file`_
131131

132-
.. _Project structure: \
133-
https://packaging.python.org/tutorials/packaging-projects/#packaging-python-projects
134-
.. _Building and packaging the project: \
135-
https://packaging.python.org/tutorials/packaging-projects/#creating-the-package-files
136-
.. _Uploading the project to the Python Package Index: \
137-
https://packaging.python.org/tutorials/packaging-projects/#uploading-the-distribution-archives
138-
.. _The .pypirc file: \
139-
https://packaging.python.org/specifications/pypirc/
132+
.. _Project structure: https://packaging.python.org/tutorials/packaging-projects/#packaging-python-projects
133+
.. _Building and packaging the project: https://packaging.python.org/tutorials/packaging-projects/#creating-the-package-files
134+
.. _Uploading the project to the Python Package Index: https://packaging.python.org/tutorials/packaging-projects/#uploading-the-distribution-archives
135+
.. _The .pypirc file: https://packaging.python.org/specifications/pypirc/
140136

141137

142138
How do I...?

Doc/extending/newtypes.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ Here is an example::
337337
}
338338

339339
PyErr_Format(PyExc_AttributeError,
340-
"'%.50s' object has no attribute '%.400s'",
340+
"'%.100s' object has no attribute '%.400s'",
341341
tp->tp_name, name);
342342
return NULL;
343343
}

Doc/extending/newtypes_tutorial.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ standard Python floats::
8888
The second bit is the definition of the type object. ::
8989

9090
static PyTypeObject CustomType = {
91-
PyVarObject_HEAD_INIT(NULL, 0)
91+
.ob_base = PyVarObject_HEAD_INIT(NULL, 0)
9292
.tp_name = "custom.Custom",
9393
.tp_doc = PyDoc_STR("Custom objects"),
9494
.tp_basicsize = sizeof(CustomObject),
@@ -109,7 +109,7 @@ common practice to not specify them explicitly unless you need them.
109109

110110
We're going to pick it apart, one field at a time::
111111

112-
PyVarObject_HEAD_INIT(NULL, 0)
112+
.ob_base = PyVarObject_HEAD_INIT(NULL, 0)
113113

114114
This line is mandatory boilerplate to initialize the ``ob_base``
115115
field mentioned above. ::

Doc/faq/library.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -780,7 +780,7 @@ socket to :meth:`select.select` to check if it's writable.
780780
The :mod:`asyncio` module provides a general purpose single-threaded and
781781
concurrent asynchronous library, which can be used for writing non-blocking
782782
network code.
783-
The third-party `Twisted <https://twistedmatrix.com/trac/>`_ library is
783+
The third-party `Twisted <https://twisted.org/>`_ library is
784784
a popular and feature-rich alternative.
785785
786786

Doc/glossary.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ Glossary
214214
A callable is an object that can be called, possibly with a set
215215
of arguments (see :term:`argument`), with the following syntax::
216216

217-
callable(argument1, argument2, ...)
217+
callable(argument1, argument2, argumentN)
218218

219219
A :term:`function`, and by extension a :term:`method`, is a callable.
220220
An instance of a class that implements the :meth:`~object.__call__`

0 commit comments

Comments
 (0)