Skip to content

Commit e1dd4e4

Browse files
committed
Merge branch 'main' into func-watchers
2 parents a79e618 + 6e3cc72 commit e1dd4e4

File tree

1,209 files changed

+32629
-46484
lines changed

Some content is hidden

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

1,209 files changed

+32629
-46484
lines changed

.azure-pipelines/posix-steps.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ steps:
6868
- ${{ if eq(parameters.patchcheck, 'true') }}:
6969
- script: |
7070
git fetch origin
71-
./python Tools/scripts/patchcheck.py --ci true
71+
./python Tools/patchcheck/patchcheck.py --ci true
7272
displayName: 'Run patchcheck.py'
7373
condition: and(succeeded(), eq(variables['Build.Reason'], 'PullRequest'))
7474

.gitattributes

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ Doc/library/token-list.inc generated
6969
Include/internal/pycore_ast.h generated
7070
Include/internal/pycore_ast_state.h generated
7171
Include/internal/pycore_opcode.h generated
72-
Include/internal/pycore_runtime_init_generated.h generated
72+
Include/internal/pycore_*_generated.h generated
7373
Include/opcode.h generated
7474
Include/token.h generated
7575
Lib/keyword.py generated
@@ -82,6 +82,7 @@ Parser/parser.c generated
8282
Parser/token.c generated
8383
Programs/test_frozenmain.h generated
8484
Python/Python-ast.c generated
85+
Python/generated_cases.c.h generated
8586
Python/opcode_targets.h generated
8687
Python/stdlib_module_names.h generated
8788
Tools/peg_generator/pegen/grammar_parser.py generated

.github/CODEOWNERS

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,15 +55,15 @@ Python/traceback.c @iritkatriel
5555
/Lib/html/ @ezio-melotti
5656
/Lib/_markupbase.py @ezio-melotti
5757
/Lib/test/test_html*.py @ezio-melotti
58-
/Tools/scripts/*html5* @ezio-melotti
58+
/Tools/build/parse_html5_entities.py @ezio-melotti
5959

6060
# Import (including importlib).
6161
# Ignoring importlib.h so as to not get flagged on
6262
# all pull requests that change the emitted
6363
# bytecode.
6464
**/*import*.c @brettcannon @encukou @ericsnowcurrently @ncoghlan @warsaw
6565
**/*import*.py @brettcannon @encukou @ericsnowcurrently @ncoghlan @warsaw
66-
**/*importlib/resources/* @jaraco @warsaw @brettcannon
66+
**/*importlib/resources/* @jaraco @warsaw @brettcannon @FFY00
6767
**/importlib/metadata/* @jaraco @warsaw
6868

6969
# Dates and times
@@ -135,10 +135,8 @@ Lib/ast.py @isidentical
135135

136136
**/*idlelib* @terryjreedy
137137

138-
**/*typing* @gvanrossum @Fidget-Spinner @JelleZijlstra
138+
**/*typing* @gvanrossum @Fidget-Spinner @JelleZijlstra @AlexWaygood
139139

140-
**/*asyncore @giampaolo
141-
**/*asynchat @giampaolo
142140
**/*ftplib @giampaolo
143141
**/*shutil @giampaolo
144142

@@ -148,6 +146,8 @@ Lib/ast.py @isidentical
148146

149147
**/*tomllib* @encukou
150148

149+
**/*sysconfig* @FFY00
150+
151151
# macOS
152152
/Mac/ @python/macos-team
153153
**/*osx_support* @python/macos-team

.github/CONTRIBUTING.rst

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,9 @@ Contributing to Python
44
Build Status
55
------------
66

7-
- main
7+
- `Buildbot status overview <https://buildbot.python.org/all/#/release_status>`_
88

9-
+ `Stable buildbots <https://buildbot.python.org/3.x.stable/>`_
10-
11-
- 3.9
12-
13-
+ `Stable buildbots <https://buildbot.python.org/3.9.stable/>`_
14-
15-
- 3.8
16-
17-
+ `Stable buildbots <https://buildbot.python.org/3.8.stable/>`_
18-
19-
- 3.7
20-
21-
+ `Stable buildbots <https://buildbot.python.org/3.7.stable/>`_
9+
- `GitHub Actions status <https://github.com/python/cpython/actions/workflows/build.yml>`_
2210

2311

2412
Thank You

.github/SECURITY.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
The Python team applies security fixes according to the table
66
in [the devguide](
7-
https://devguide.python.org/#status-of-python-branches
7+
https://devguide.python.org/versions/#supported-versions
88
).
99

1010
## Reporting a Vulnerability

.github/workflows/build.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
id: check
4242
run: |
4343
if [ -z "$GITHUB_BASE_REF" ]; then
44-
echo '::set-output name=run_tests::true'
44+
echo "run_tests=true" >> $GITHUB_OUTPUT
4545
else
4646
git fetch origin $GITHUB_BASE_REF --depth=1
4747
# git diff "origin/$GITHUB_BASE_REF..." (3 dots) may be more
@@ -57,7 +57,7 @@ jobs:
5757
# into the PR branch anyway.
5858
#
5959
# https://github.com/python/core-workflow/issues/373
60-
git diff --name-only origin/$GITHUB_BASE_REF.. | grep -qvE '(\.rst$|^Doc|^Misc)' && echo '::set-output name=run_tests::true' || true
60+
git diff --name-only origin/$GITHUB_BASE_REF.. | grep -qvE '(\.rst$|^Doc|^Misc)' && echo "run_tests=true" >> $GITHUB_OUTPUT || true
6161
fi
6262
6363
check_generated_files:
@@ -73,7 +73,7 @@ jobs:
7373
- name: Add ccache to PATH
7474
run: echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV
7575
- name: Configure ccache action
76-
uses: hendrikmuhs/ccache-action@v1
76+
uses: hendrikmuhs/ccache-action@v1.2
7777
- name: Check Autoconf version 2.69 and aclocal 1.16.3
7878
run: |
7979
grep "Generated by GNU Autoconf 2.69" configure
@@ -202,7 +202,7 @@ jobs:
202202
run: |
203203
echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV
204204
- name: Configure ccache action
205-
uses: hendrikmuhs/ccache-action@v1
205+
uses: hendrikmuhs/ccache-action@v1.2
206206
- name: Setup directory envs for out-of-tree builds
207207
run: |
208208
echo "CPYTHON_RO_SRCDIR=$(realpath -m ${GITHUB_WORKSPACE}/../cpython-ro-srcdir)" >> $GITHUB_ENV
@@ -265,7 +265,7 @@ jobs:
265265
run: |
266266
echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV
267267
- name: Configure ccache action
268-
uses: hendrikmuhs/ccache-action@v1
268+
uses: hendrikmuhs/ccache-action@v1.2
269269
- name: Configure CPython
270270
run: ./configure --with-pydebug --with-openssl=$OPENSSL_DIR
271271
- name: Build CPython
@@ -309,7 +309,7 @@ jobs:
309309
run: |
310310
echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV
311311
- name: Configure ccache action
312-
uses: hendrikmuhs/ccache-action@v1
312+
uses: hendrikmuhs/ccache-action@v1.2
313313
- name: Configure CPython
314314
run: ./configure --with-address-sanitizer --without-pymalloc
315315
- name: Build CPython

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ on:
66
paths:
77
- 'Lib/ensurepip/_bundled/**'
88
- '.github/workflows/verify-ensurepip-wheels.yml'
9-
- 'Tools/scripts/verify_ensurepip_wheels.py'
9+
- 'Tools/build/verify_ensurepip_wheels.py'
1010
pull_request:
1111
paths:
1212
- 'Lib/ensurepip/_bundled/**'
1313
- '.github/workflows/verify-ensurepip-wheels.yml'
14-
- 'Tools/scripts/verify_ensurepip_wheels.py'
14+
- 'Tools/build/verify_ensurepip_wheels.py'
1515

1616
permissions:
1717
contents: read
@@ -29,4 +29,4 @@ jobs:
2929
with:
3030
python-version: '3'
3131
- name: Compare checksums of bundled pip and setuptools to ones published on PyPI
32-
run: ./Tools/scripts/verify_ensurepip_wheels.py
32+
run: ./Tools/build/verify_ensurepip_wheels.py

.gitignore

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ gmon.out
4141
.DS_Store
4242

4343
*.exe
44-
!Lib/distutils/command/*.exe
4544

4645
# Ignore core dumps... but not Tools/msi/core/ or the like.
4746
core
@@ -58,7 +57,6 @@ Doc/.venv/
5857
Doc/env/
5958
Doc/.env/
6059
Include/pydtrace_probes.h
61-
Lib/distutils/command/*.pdb
6260
Lib/lib2to3/*.pickle
6361
Lib/site-packages/*
6462
!Lib/site-packages/README.txt
@@ -116,6 +114,7 @@ PCbuild/win32/
116114
Tools/unicode/data/
117115
/autom4te.cache
118116
/build/
117+
/builddir/
119118
/config.cache
120119
/config.log
121120
/config.status
@@ -143,7 +142,7 @@ Tools/ssl/win32
143142
Tools/freeze/test/outdir
144143

145144
# The frozen modules are always generated by the build so we don't
146-
# keep them in the repo. Also see Tools/scripts/freeze_modules.py.
145+
# keep them in the repo. Also see Tools/build/freeze_modules.py.
147146
Python/frozen_modules/*.h
148147
# The manifest can be generated at any time with "make regen-frozen".
149148
Python/frozen_modules/MANIFEST

Doc/Makefile

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ PAPEROPT_letter = -D latex_elements.papersize=letterpaper
2121
ALLSPHINXOPTS = -b $(BUILDER) -d build/doctrees $(PAPEROPT_$(PAPER)) -j auto \
2222
$(SPHINXOPTS) $(SPHINXERRORHANDLING) . build/$(BUILDER) $(SOURCES)
2323

24-
.PHONY: help build html htmlhelp latex text texinfo changes linkcheck \
25-
suspicious coverage doctest pydoc-topics htmlview clean dist check serve \
26-
autobuild-dev autobuild-stable venv
24+
.PHONY: help build html htmlhelp latex text texinfo epub changes linkcheck \
25+
coverage doctest pydoc-topics htmlview clean clean-venv venv dist check serve \
26+
autobuild-dev autobuild-dev-html autobuild-stable autobuild-stable-html
2727

2828
help:
2929
@echo "Please use \`make <target>' where <target> is one of"
@@ -42,7 +42,6 @@ help:
4242
@echo " doctest to run doctests in the documentation"
4343
@echo " pydoc-topics to regenerate the pydoc topics file"
4444
@echo " dist to create a \"dist\" directory with archived docs for download"
45-
@echo " suspicious to check for suspicious markup in output text"
4645
@echo " check to run a check for frequent markup errors"
4746

4847
build:
@@ -110,18 +109,6 @@ linkcheck:
110109
"or in build/$(BUILDER)/output.txt"; \
111110
false; }
112111

113-
suspicious: BUILDER = suspicious
114-
suspicious:
115-
@$(MAKE) build BUILDER=$(BUILDER) || { \
116-
echo "Suspicious check complete; look for any errors in the above output" \
117-
"or in build/$(BUILDER)/suspicious.csv. If all issues are false" \
118-
"positives, append that file to tools/susp-ignored.csv."; \
119-
false; }
120-
@echo "⚠ make suspicious is deprecated and will be removed soon."
121-
@echo "⚠ Use:"
122-
@echo "⚠ make check"
123-
@echo "⚠ instead."
124-
125112
coverage: BUILDER = coverage
126113
coverage: build
127114
@echo "Coverage finished; see c.txt and python.txt in build/coverage"

Doc/README.rst

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,6 @@ Available make targets are:
9393
plain text documentation for the labels defined in
9494
``tools/pyspecific.py`` -- pydoc needs these to show topic and keyword help.
9595

96-
* "suspicious", which checks the parsed markup for text that looks like
97-
malformed and thus unconverted reST.
98-
9996
* "check", which checks for frequent markup errors.
10097

10198
* "serve", which serves the build/html directory on port 8000.

Doc/c-api/call.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ This is a pointer to a function with the following signature:
9393
and they must be unique.
9494
If there are no keyword arguments, then *kwnames* can instead be *NULL*.
9595

96-
.. c:macro:: PY_VECTORCALL_ARGUMENTS_OFFSET
96+
.. data:: PY_VECTORCALL_ARGUMENTS_OFFSET
9797

9898
If this flag is set in a vectorcall *nargsf* argument, the callee is allowed
9999
to temporarily change ``args[-1]``. In other words, *args* points to

Doc/c-api/frame.rst

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,25 @@ See also :ref:`Reflection <reflection>`.
7979
.. versionadded:: 3.11
8080
8181
82+
.. c:function:: PyObject* PyFrame_GetVar(PyFrameObject *frame, PyObject *name)
83+
84+
Get the variable *name* of *frame*.
85+
86+
* Return a :term:`strong reference` to the variable value on success.
87+
* Raise :exc:`NameError` and return ``NULL`` if the variable does not exist.
88+
* Raise an exception and return ``NULL`` on error.
89+
90+
.. versionadded:: 3.12
91+
92+
93+
.. c:function:: PyObject* PyFrame_GetVarString(PyFrameObject *frame, const char *name)
94+
95+
Similar to :c:func:`PyFrame_GetVar`, but the variable name is a C string
96+
encoded in UTF-8.
97+
98+
.. versionadded:: 3.12
99+
100+
82101
.. c:function:: PyObject* PyFrame_GetLocals(PyFrameObject *frame)
83102
84103
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
@@ -1933,7 +1933,7 @@ is not possible due to its implementation being opaque at build time.
19331933
19341934
.. note::
19351935
A freed key becomes a dangling pointer. You should reset the key to
1936-
`NULL`.
1936+
``NULL``.
19371937
19381938
19391939
Methods

Doc/c-api/init_config.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1571,8 +1571,6 @@ Private provisional API:
15711571
15721572
* :c:member:`PyConfig._init_main`: if set to ``0``,
15731573
:c:func:`Py_InitializeFromConfig` stops at the "Core" initialization phase.
1574-
* :c:member:`PyConfig._isolated_interpreter`: if non-zero,
1575-
disallow threads, subprocesses and fork.
15761574
15771575
.. c:function:: PyStatus _Py_InitializeMain(void)
15781576

Doc/c-api/memory.rst

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,8 @@ for the I/O buffer escapes completely the Python memory manager.
9595
Allocator Domains
9696
=================
9797

98+
.. _allocator-domains:
99+
98100
All allocating functions belong to one of three different "domains" (see also
99101
:c:type:`PyMemAllocatorDomain`). These domains represent different allocation
100102
strategies and are optimized for different purposes. The specific details on
@@ -479,6 +481,25 @@ Customize Memory Allocators
479481
See also :c:member:`PyPreConfig.allocator` and :ref:`Preinitialize Python
480482
with PyPreConfig <c-preinit>`.
481483
484+
.. warning::
485+
486+
:c:func:`PyMem_SetAllocator` does have the following contract:
487+
488+
* It can be called after :c:func:`Py_PreInitialize` and before
489+
:c:func:`Py_InitializeFromConfig` to install a custom memory
490+
allocator. There are no restrictions over the installed allocator
491+
other than the ones imposed by the domain (for instance, the Raw
492+
Domain allows the allocator to be called without the GIL held). See
493+
:ref:`the section on allocator domains <allocator-domains>` for more
494+
information.
495+
496+
* If called after Python has finish initializing (after
497+
:c:func:`Py_InitializeFromConfig` has been called) the allocator
498+
**must** wrap the existing allocator. Substituting the current
499+
allocator for some other arbitrary one is **not supported**.
500+
501+
502+
482503
.. c:function:: void PyMem_SetupDebugHooks(void)
483504
484505
Setup :ref:`debug hooks in the Python memory allocators <pymem-debug-hooks>`

0 commit comments

Comments
 (0)