Skip to content

Commit 2d28a2a

Browse files
author
Erlend E. Aasland
committed
Merge branch 'main' into sqlite-begin
2 parents 4a7d9a1 + f349124 commit 2d28a2a

File tree

561 files changed

+17957
-12789
lines changed

Some content is hidden

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

561 files changed

+17957
-12789
lines changed

.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/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/[email protected].5
153+
uses: actions/[email protected].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/[email protected].5
201+
uses: actions/[email protected].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/apiabiversion.rst

Lines changed: 52 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -6,34 +6,57 @@
66
API and ABI Versioning
77
***********************
88

9-
``PY_VERSION_HEX`` is the Python version number encoded in a single integer.
10-
11-
For example if the ``PY_VERSION_HEX`` is set to ``0x030401a2``, the underlying
12-
version information can be found by treating it as a 32 bit number in
13-
the following manner:
14-
15-
+-------+-------------------------+------------------------------------------------+
16-
| Bytes | Bits (big endian order) | Meaning |
17-
+=======+=========================+================================================+
18-
| ``1`` | ``1-8`` | ``PY_MAJOR_VERSION`` (the ``3`` in |
19-
| | | ``3.4.1a2``) |
20-
+-------+-------------------------+------------------------------------------------+
21-
| ``2`` | ``9-16`` | ``PY_MINOR_VERSION`` (the ``4`` in |
22-
| | | ``3.4.1a2``) |
23-
+-------+-------------------------+------------------------------------------------+
24-
| ``3`` | ``17-24`` | ``PY_MICRO_VERSION`` (the ``1`` in |
25-
| | | ``3.4.1a2``) |
26-
+-------+-------------------------+------------------------------------------------+
27-
| ``4`` | ``25-28`` | ``PY_RELEASE_LEVEL`` (``0xA`` for alpha, |
28-
| | | ``0xB`` for beta, ``0xC`` for release |
29-
| | | candidate and ``0xF`` for final), in this |
30-
| | | case it is alpha. |
31-
+-------+-------------------------+------------------------------------------------+
32-
| | ``29-32`` | ``PY_RELEASE_SERIAL`` (the ``2`` in |
33-
| | | ``3.4.1a2``, zero for final releases) |
34-
+-------+-------------------------+------------------------------------------------+
35-
36-
Thus ``3.4.1a2`` is hexversion ``0x030401a2``.
9+
CPython exposes its version number in the following macros.
10+
Note that these correspond to the version code is **built** with,
11+
not necessarily the version used at **run time**.
3712

38-
All the given macros are defined in :source:`Include/patchlevel.h`.
13+
See :ref:`stable` for a discussion of API and ABI stability across versions.
14+
15+
.. c:macro:: PY_MAJOR_VERSION
16+
17+
The ``3`` in ``3.4.1a2``.
18+
19+
.. c:macro:: PY_MINOR_VERSION
20+
21+
The ``4`` in ``3.4.1a2``.
22+
23+
.. c:macro:: PY_MICRO_VERSION
24+
25+
The ``1`` in ``3.4.1a2``.
26+
27+
.. c:macro:: PY_RELEASE_LEVEL
28+
29+
The ``a`` in ``3.4.1a2``.
30+
This can be ``0xA`` for alpha, ``0xB`` for beta, ``0xC`` for release
31+
candidate or ``0xF`` for final.
3932

33+
.. c:macro:: PY_RELEASE_SERIAL
34+
35+
The ``2`` in ``3.4.1a2``. Zero for final releases.
36+
37+
.. c:macro:: PY_VERSION_HEX
38+
39+
The Python version number encoded in a single integer.
40+
41+
The underlying version information can be found by treating it as a 32 bit
42+
number in the following manner:
43+
44+
+-------+-------------------------+-------------------------+--------------------------+
45+
| Bytes | Bits (big endian order) | Meaning | Value for ``3.4.1a2`` |
46+
+=======+=========================+=========================+==========================+
47+
| 1 | 1-8 | ``PY_MAJOR_VERSION`` | ``0x03`` |
48+
+-------+-------------------------+-------------------------+--------------------------+
49+
| 2 | 9-16 | ``PY_MINOR_VERSION`` | ``0x04`` |
50+
+-------+-------------------------+-------------------------+--------------------------+
51+
| 3 | 17-24 | ``PY_MICRO_VERSION`` | ``0x01`` |
52+
+-------+-------------------------+-------------------------+--------------------------+
53+
| 4 | 25-28 | ``PY_RELEASE_LEVEL`` | ``0xA`` |
54+
+ +-------------------------+-------------------------+--------------------------+
55+
| | 29-32 | ``PY_RELEASE_SERIAL`` | ``0x2`` |
56+
+-------+-------------------------+-------------------------+--------------------------+
57+
58+
Thus ``3.4.1a2`` is hexversion ``0x030401a2`` and ``3.10.0`` is
59+
hexversion ``0x030a00f0``.
60+
61+
62+
All the given macros are defined in :source:`Include/patchlevel.h`.

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/init.rst

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,11 @@ Process-wide parameters
323323
single: main()
324324
triple: stdin; stdout; sdterr
325325
326+
This API is kept for backward compatibility: setting
327+
:c:member:`PyConfig.stdio_encoding` and :c:member:`PyConfig.stdio_errors`
328+
should be used instead, see :ref:`Python Initialization Configuration
329+
<init-config>`.
330+
326331
This function should be called before :c:func:`Py_Initialize`, if it is
327332
called at all. It specifies which encoding and error handling to use
328333
with standard IO, with the same meanings as in :func:`str.encode`.
@@ -345,6 +350,8 @@ Process-wide parameters
345350
346351
.. versionadded:: 3.4
347352
353+
.. deprecated:: 3.11
354+
348355
349356
.. c:function:: void Py_SetProgramName(const wchar_t *name)
350357
@@ -353,6 +360,10 @@ Process-wide parameters
353360
single: main()
354361
single: Py_GetPath()
355362
363+
This API is kept for backward compatibility: setting
364+
:c:member:`PyConfig.program_name` should be used instead, see :ref:`Python
365+
Initialization Configuration <init-config>`.
366+
356367
This function should be called before :c:func:`Py_Initialize` is called for
357368
the first time, if it is called at all. It tells the interpreter the value
358369
of the ``argv[0]`` argument to the :c:func:`main` function of the program
@@ -367,6 +378,8 @@ Process-wide parameters
367378
Use :c:func:`Py_DecodeLocale` to decode a bytes string to get a
368379
:c:type:`wchar_*` string.
369380
381+
.. deprecated:: 3.11
382+
370383
371384
.. c:function:: wchar* Py_GetProgramName()
372385
@@ -495,6 +508,11 @@ Process-wide parameters
495508
single: path (in module sys)
496509
single: Py_GetPath()
497510
511+
This API is kept for backward compatibility: setting
512+
:c:member:`PyConfig.module_search_paths` and
513+
:c:member:`PyConfig.module_search_paths_set` should be used instead, see
514+
:ref:`Python Initialization Configuration <init-config>`.
515+
498516
Set the default module search path. If this function is called before
499517
:c:func:`Py_Initialize`, then :c:func:`Py_GetPath` won't attempt to compute a
500518
default search path but uses the one provided instead. This is useful if
@@ -518,6 +536,8 @@ Process-wide parameters
518536
The program full path is now used for :data:`sys.executable`, instead
519537
of the program name.
520538
539+
.. deprecated:: 3.11
540+
521541
522542
.. c:function:: const char* Py_GetVersion()
523543
@@ -617,6 +637,9 @@ Process-wide parameters
617637
Use :c:func:`Py_DecodeLocale` to decode a bytes string to get a
618638
:c:type:`wchar_*` string.
619639

640+
See also :c:member:`PyConfig.orig_argv` and :c:member:`PyConfig.argv`
641+
members of the :ref:`Python Initialization Configuration <init-config>`.
642+
620643
.. note::
621644
It is recommended that applications embedding the Python interpreter
622645
for purposes other than executing a single script pass ``0`` as *updatepath*,
@@ -644,11 +667,18 @@ Process-wide parameters
644667
Use :c:func:`Py_DecodeLocale` to decode a bytes string to get a
645668
:c:type:`wchar_*` string.
646669
670+
See also :c:member:`PyConfig.orig_argv` and :c:member:`PyConfig.argv`
671+
members of the :ref:`Python Initialization Configuration <init-config>`.
672+
647673
.. versionchanged:: 3.4 The *updatepath* value depends on :option:`-I`.
648674
649675
650676
.. c:function:: void Py_SetPythonHome(const wchar_t *home)
651677
678+
This API is kept for backward compatibility: setting
679+
:c:member:`PyConfig.home` should be used instead, see :ref:`Python
680+
Initialization Configuration <init-config>`.
681+
652682
Set the default "home" directory, that is, the location of the standard
653683
Python libraries. See :envvar:`PYTHONHOME` for the meaning of the
654684
argument string.
@@ -661,6 +691,8 @@ Process-wide parameters
661691
Use :c:func:`Py_DecodeLocale` to decode a bytes string to get a
662692
:c:type:`wchar_*` string.
663693
694+
.. deprecated:: 3.11
695+
664696
665697
.. c:function:: w_char* Py_GetPythonHome()
666698

Doc/c-api/memory.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -476,6 +476,8 @@ Customize Memory Allocators
476476
the :c:func:`PyMem_SetupDebugHooks` function must be called to reinstall the
477477
debug hooks on top on the new allocator.
478478
479+
See also :c:member:`PyPreConfig.allocator` and :ref:`Preinitialize Python
480+
with PyPreConfig <c-preinit>`.
479481
480482
.. c:function:: void PyMem_SetupDebugHooks(void)
481483

0 commit comments

Comments
 (0)