Skip to content

Commit 0f66cb3

Browse files
authored
Merge branch 'main' into shutil_unpack_archive_false_positives
2 parents 055e113 + ad0e2a9 commit 0f66cb3

File tree

321 files changed

+7705
-4102
lines changed

Some content is hidden

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

321 files changed

+7705
-4102
lines changed

.github/CODEOWNERS

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,18 @@ Objects/type* @markshannon
2828
Objects/codeobject.c @markshannon
2929
Objects/frameobject.c @markshannon
3030
Objects/call.c @markshannon
31-
Python/ceval.c @markshannon
31+
Python/ceval*.c @markshannon @gvanrossum
32+
Python/ceval*.h @markshannon @gvanrossum
3233
Python/compile.c @markshannon @iritkatriel
3334
Python/assemble.c @markshannon @iritkatriel
3435
Python/flowgraph.c @markshannon @iritkatriel
3536
Python/ast_opt.c @isidentical
37+
Python/bytecodes.c @markshannon @gvanrossum
38+
Python/optimizer*.c @markshannon @gvanrossum
3639
Lib/test/test_patma.py @brandtbucher
3740
Lib/test/test_peepholer.py @brandtbucher
3841
Lib/test/test_type_*.py @JelleZijlstra
42+
Lib/test/test_capi/test_misc.py @markshannon @gvanrossum
3943

4044
# Exceptions
4145
Lib/traceback.py @iritkatriel
@@ -102,6 +106,9 @@ Include/internal/pycore_time.h @pganssle @abalkin
102106
/Lib/tokenize.py @pablogsal @lysnikolaou
103107
/Lib/test/test_tokenize.py @pablogsal @lysnikolaou
104108

109+
# Code generator
110+
/Tools/cases_generator/ @gvanrossum
111+
105112
# AST
106113
Python/ast.c @isidentical
107114
Parser/asdl.py @isidentical
@@ -151,7 +158,7 @@ Doc/c-api/stable.rst @encukou
151158

152159
**/*idlelib* @terryjreedy
153160

154-
**/*typing* @gvanrossum @JelleZijlstra @AlexWaygood
161+
**/*typing* @JelleZijlstra @AlexWaygood
155162

156163
**/*ftplib @giampaolo
157164
**/*shutil @giampaolo

.github/workflows/build.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,9 @@ jobs:
120120

121121
check_generated_files:
122122
name: 'Check if generated files are up to date'
123-
runs-on: ubuntu-latest
123+
# Don't use ubuntu-latest but a specific version to make the job
124+
# reproducible: to get the same tools versions (autoconf, aclocal, ...)
125+
runs-on: ubuntu-22.04
124126
timeout-minutes: 60
125127
needs: check_source
126128
if: needs.check_source.outputs.run_tests == 'true'
@@ -143,15 +145,16 @@ jobs:
143145
- name: Check Autoconf and aclocal versions
144146
run: |
145147
grep "Generated by GNU Autoconf 2.71" configure
146-
grep "aclocal 1.16.4" aclocal.m4
148+
grep "aclocal 1.16.5" aclocal.m4
147149
grep -q "runstatedir" configure
148150
grep -q "PKG_PROG_PKG_CONFIG" aclocal.m4
149151
- name: Configure CPython
150152
run: |
151153
# Build Python with the libpython dynamic library
152154
./configure --config-cache --with-pydebug --enable-shared
153-
- name: Regenerate autoconf files with container image
154-
run: make regen-configure
155+
- name: Regenerate autoconf files
156+
# Same command used by Tools/build/regen-configure.sh ($AUTORECONF)
157+
run: autoreconf -ivf -Werror
155158
- name: Build CPython
156159
run: |
157160
make -j4 regen-all

.github/workflows/posix-deps-apt.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
#!/bin/sh
22
apt-get update
33

4+
# autoconf-archive is needed by autoreconf (check_generated_files job)
45
apt-get -yq install \
56
build-essential \
67
pkg-config \
8+
autoconf-archive \
79
ccache \
810
gdb \
911
lcov \

Doc/Makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ help:
2929
@echo " venv to create a venv with necessary tools"
3030
@echo " html to make standalone HTML files"
3131
@echo " htmlview to open the index page built by the html target in your browser"
32+
@echo " htmllive to rebuild and reload HTML files in your browser"
3233
@echo " htmlhelp to make HTML files and a HTML help project"
3334
@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
3435
@echo " text to make plain text files"
@@ -139,6 +140,11 @@ pydoc-topics: build
139140
htmlview: html
140141
$(PYTHON) -c "import os, webbrowser; webbrowser.open('file://' + os.path.realpath('build/html/index.html'))"
141142

143+
.PHONY: htmllive
144+
htmllive: SPHINXBUILD = $(VENVDIR)/bin/sphinx-autobuild
145+
htmllive: SPHINXOPTS = --re-ignore="/venv/"
146+
htmllive: html
147+
142148
.PHONY: clean
143149
clean: clean-venv
144150
-rm -rf build/*

Doc/c-api/bool.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,19 +26,19 @@ are available, however.
2626
.. c:var:: PyObject* Py_False
2727
2828
The Python ``False`` object. This object has no methods and is
29-
`immortal <https://peps.python.org/pep-0683/>`_.
29+
:term:`immortal`.
3030
31-
.. versionchanged:: 3.12
32-
:c:data:`Py_False` is immortal.
31+
.. versionchanged:: 3.12
32+
:c:data:`Py_False` is :term:`immortal`.
3333
3434
3535
.. c:var:: PyObject* Py_True
3636
3737
The Python ``True`` object. This object has no methods and is
38-
`immortal <https://peps.python.org/pep-0683/>`_.
38+
:term:`immortal`.
3939
40-
.. versionchanged:: 3.12
41-
:c:data:`Py_True` is immortal.
40+
.. versionchanged:: 3.12
41+
:c:data:`Py_True` is :term:`immortal`.
4242
4343
4444
.. c:macro:: Py_RETURN_FALSE

Doc/c-api/dict.rst

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,33 @@ Dictionary Objects
173173
174174
.. versionadded:: 3.4
175175
176+
177+
.. c:function:: int PyDict_Pop(PyObject *p, PyObject *key, PyObject **result)
178+
179+
Remove *key* from dictionary *p* and optionally return the removed value.
180+
Do not raise :exc:`KeyError` if the key missing.
181+
182+
- If the key is present, set *\*result* to a new reference to the removed
183+
value if *result* is not ``NULL``, and return ``1``.
184+
- If the key is missing, set *\*result* to ``NULL`` if *result* is not
185+
``NULL``, and return ``0``.
186+
- On error, raise an exception and return ``-1``.
187+
188+
This is similar to :meth:`dict.pop`, but without the default value and
189+
not raising :exc:`KeyError` if the key missing.
190+
191+
.. versionadded:: 3.13
192+
193+
194+
.. c:function:: int PyDict_PopString(PyObject *p, const char *key, PyObject **result)
195+
196+
Similar to :c:func:`PyDict_Pop`, but *key* is specified as a
197+
:c:expr:`const char*` UTF-8 encoded bytes string, rather than a
198+
:c:expr:`PyObject*`.
199+
200+
.. versionadded:: 3.13
201+
202+
176203
.. c:function:: PyObject* PyDict_Items(PyObject *p)
177204
178205
Return a :c:type:`PyListObject` containing all the items from the dictionary.

Doc/c-api/hash.rst

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
.. highlight:: c
2+
3+
PyHash API
4+
----------
5+
6+
See also the :c:member:`PyTypeObject.tp_hash` member.
7+
8+
.. c:type:: Py_hash_t
9+
10+
Hash value type: signed integer.
11+
12+
.. versionadded:: 3.2
13+
14+
.. c:type:: Py_uhash_t
15+
16+
Hash value type: unsigned integer.
17+
18+
.. versionadded:: 3.2
19+
20+
21+
.. c:type:: PyHash_FuncDef
22+
23+
Hash function definition used by :c:func:`PyHash_GetFuncDef`.
24+
25+
.. c::member:: Py_hash_t (*const hash)(const void *, Py_ssize_t)
26+
27+
Hash function.
28+
29+
.. c:member:: const char *name
30+
31+
Hash function name (UTF-8 encoded string).
32+
33+
.. c:member:: const int hash_bits
34+
35+
Internal size of the hash value in bits.
36+
37+
.. c:member:: const int seed_bits
38+
39+
Size of seed input in bits.
40+
41+
.. versionadded:: 3.4
42+
43+
44+
.. c:function:: PyHash_FuncDef* PyHash_GetFuncDef(void)
45+
46+
Get the hash function definition.
47+
48+
.. versionadded:: 3.4

Doc/c-api/init.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1485,7 +1485,7 @@ otherwise immutable (e.g. ``None``, ``(1, 5)``) can't normally be shared
14851485
because of the refcount. One simple but less-efficient approach around
14861486
this is to use a global lock around all use of some state (or object).
14871487
Alternately, effectively immutable objects (like integers or strings)
1488-
can be made safe in spite of their refcounts by making them "immortal".
1488+
can be made safe in spite of their refcounts by making them :term:`immortal`.
14891489
In fact, this has been done for the builtin singletons, small integers,
14901490
and a number of other builtin objects.
14911491

Doc/c-api/init_config.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1170,7 +1170,7 @@ PyConfig
11701170
11711171
.. c:member:: int show_ref_count
11721172
1173-
Show total reference count at exit (excluding immortal objects)?
1173+
Show total reference count at exit (excluding :term:`immortal` objects)?
11741174
11751175
Set to ``1`` by :option:`-X showrefcount <-X>` command line option.
11761176

Doc/c-api/list.rst

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,30 @@ List Objects
128128
list is not supported.
129129
130130
131+
.. c:function:: int PyList_Extend(PyObject *list, PyObject *iterable)
132+
133+
Extend *list* with the contents of *iterable*. This is the same as
134+
``PyList_SetSlice(list, PY_SSIZE_T_MAX, PY_SSIZE_T_MAX, iterable)``
135+
and analogous to ``list.extend(iterable)`` or ``list += iterable``.
136+
137+
Raise an exception and return ``-1`` if *list* is not a :class:`list`
138+
object. Return 0 on success.
139+
140+
.. versionadded:: 3.13
141+
142+
143+
.. c:function:: int PyList_Clear(PyObject *list)
144+
145+
Remove all items from *list*. This is the same as
146+
``PyList_SetSlice(list, 0, PY_SSIZE_T_MAX, NULL)`` and analogous to
147+
``list.clear()`` or ``del list[:]``.
148+
149+
Raise an exception and return ``-1`` if *list* is not a :class:`list`
150+
object. Return 0 on success.
151+
152+
.. versionadded:: 3.13
153+
154+
131155
.. c:function:: int PyList_Sort(PyObject *list)
132156
133157
Sort the items of *list* in place. Return ``0`` on success, ``-1`` on

0 commit comments

Comments
 (0)