Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 171c71a

Browse files
authored
Merge branch 'main' into feature/os.timerfd_xxx
2 parents 908e3dc + 6b179ad commit 171c71a

116 files changed

Lines changed: 1626 additions & 1099 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.

.azure-pipelines/ci.yml

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
variables:
2-
coverage: false
3-
41
trigger: ['main', '3.11', '3.10', '3.9', '3.8', '3.7']
52

63
jobs:
@@ -14,24 +11,6 @@ jobs:
1411
- template: ./prebuild-checks.yml
1512

1613

17-
- job: macOS_CI_Tests
18-
displayName: macOS CI Tests
19-
dependsOn: Prebuild
20-
#condition: and(succeeded(), eq(dependencies.Prebuild.outputs['tests.run'], 'true'))
21-
# bpo-39837: macOS tests on Azure Pipelines are disabled
22-
condition: false
23-
24-
variables:
25-
testRunTitle: '$(build.sourceBranchName)-macos'
26-
testRunPlatform: macos
27-
28-
pool:
29-
vmImage: macos-10.15
30-
31-
steps:
32-
- template: ./macos-steps.yml
33-
34-
3514
- job: Ubuntu_CI_Tests
3615
displayName: Ubuntu CI Tests
3716
dependsOn: Prebuild
@@ -51,33 +30,6 @@ jobs:
5130
dependencies: apt
5231

5332

54-
- job: Ubuntu_Coverage_CI_Tests
55-
displayName: Ubuntu CI Tests (coverage)
56-
dependsOn: Prebuild
57-
condition: |
58-
and(
59-
and(
60-
succeeded(),
61-
eq(variables['coverage'], 'true')
62-
),
63-
eq(dependencies.Prebuild.outputs['tests.run'], 'true')
64-
)
65-
66-
pool:
67-
vmImage: ubuntu-22.04
68-
69-
variables:
70-
testRunTitle: '$(Build.SourceBranchName)-linux-coverage'
71-
testRunPlatform: linux-coverage
72-
openssl_version: 1.1.1u
73-
74-
steps:
75-
- template: ./posix-steps.yml
76-
parameters:
77-
dependencies: apt
78-
coverage: true
79-
80-
8133
- job: Windows_CI_Tests
8234
displayName: Windows CI Tests
8335
dependsOn: Prebuild

.azure-pipelines/macos-steps.yml

Lines changed: 0 additions & 27 deletions
This file was deleted.

.azure-pipelines/posix-steps.yml

Lines changed: 9 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
parameters:
2-
coverage: false
32
sudo_dependencies: sudo
43
dependencies: apt
54
patchcheck: true
@@ -23,47 +22,16 @@ steps:
2322
- script: make -j4
2423
displayName: 'Build CPython'
2524

26-
- ${{ if eq(parameters.coverage, 'true') }}:
27-
- script: ./python -m venv venv && ./venv/bin/python -m pip install -U coverage
28-
displayName: 'Set up virtual environment'
25+
- script: make pythoninfo
26+
displayName: 'Display build info'
2927

30-
- script: ./venv/bin/python -m test.pythoninfo
31-
displayName: 'Display build info'
32-
33-
- script: |
34-
$COMMAND -m coverage run --pylib -m test \
35-
--fail-env-changed \
36-
-uall,-cpu \
37-
--junit-xml=$(build.binariesDirectory)/test-results.xml \
38-
-x test_multiprocessing_fork \
39-
-x test_multiprocessing_forkserver \
40-
-x test_multiprocessing_spawn \
41-
-x test_concurrent_futures
42-
displayName: 'Tests with coverage'
43-
env:
44-
${{ if eq(parameters.xvfb, 'true') }}:
45-
COMMAND: xvfb-run ./venv/bin/python
46-
${{ if ne(parameters.xvfb, 'true') }}:
47-
COMMAND: ./venv/bin/python
48-
49-
- script: ./venv/bin/python -m coverage xml
50-
displayName: 'Generate coverage.xml'
51-
52-
- script: source ./venv/bin/activate && bash <(curl -s https://codecov.io/bash) -y .github/codecov.yml
53-
displayName: 'Publish code coverage results'
54-
55-
56-
- ${{ if ne(parameters.coverage, 'true') }}:
57-
- script: make pythoninfo
58-
displayName: 'Display build info'
59-
60-
- script: $COMMAND buildbottest TESTOPTS="-j4 -uall,-cpu --junit-xml=$(build.binariesDirectory)/test-results.xml"
61-
displayName: 'Tests'
62-
env:
63-
${{ if eq(parameters.xvfb, 'true') }}:
64-
COMMAND: xvfb-run make
65-
${{ if ne(parameters.xvfb, 'true') }}:
66-
COMMAND: make
28+
- script: $COMMAND buildbottest TESTOPTS="-j4 -uall,-cpu --junit-xml=$(build.binariesDirectory)/test-results.xml"
29+
displayName: 'Tests'
30+
env:
31+
${{ if eq(parameters.xvfb, 'true') }}:
32+
COMMAND: xvfb-run make
33+
${{ if ne(parameters.xvfb, 'true') }}:
34+
COMMAND: make
6735

6836
- ${{ if eq(parameters.patchcheck, 'true') }}:
6937
- script: |

.azure-pipelines/pr.yml

Lines changed: 0 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
variables:
2-
coverage: false
3-
41
pr: ['main', '3.11', '3.10', '3.9', '3.8', '3.7']
52

63
jobs:
@@ -14,26 +11,6 @@ jobs:
1411
- template: ./prebuild-checks.yml
1512

1613

17-
- job: macOS_PR_Tests
18-
displayName: macOS PR Tests
19-
dependsOn: Prebuild
20-
#condition: and(succeeded(), eq(dependencies.Prebuild.outputs['tests.run'], 'true'))
21-
# bpo-39837: macOS tests on Azure Pipelines are disabled
22-
condition: false
23-
24-
variables:
25-
testRunTitle: '$(system.pullRequest.TargetBranch)-macos'
26-
testRunPlatform: macos
27-
28-
pool:
29-
vmImage: macos-10.15
30-
31-
steps:
32-
- template: ./macos-steps.yml
33-
parameters:
34-
targetBranch: $(System.PullRequest.TargetBranch)
35-
36-
3714
- job: Ubuntu_PR_Tests
3815
displayName: Ubuntu PR Tests
3916
dependsOn: Prebuild
@@ -53,33 +30,6 @@ jobs:
5330
dependencies: apt
5431

5532

56-
- job: Ubuntu_Coverage_PR_Tests
57-
displayName: Ubuntu PR Tests (coverage)
58-
dependsOn: Prebuild
59-
condition: |
60-
and(
61-
and(
62-
succeeded(),
63-
eq(variables['coverage'], 'true')
64-
),
65-
eq(dependencies.Prebuild.outputs['tests.run'], 'true')
66-
)
67-
68-
pool:
69-
vmImage: ubuntu-22.04
70-
71-
variables:
72-
testRunTitle: '$(Build.SourceBranchName)-linux-coverage'
73-
testRunPlatform: linux-coverage
74-
openssl_version: 1.1.1u
75-
76-
steps:
77-
- template: ./posix-steps.yml
78-
parameters:
79-
dependencies: apt
80-
coverage: true
81-
82-
8333
- job: Windows_PR_Tests
8434
displayName: Windows PR Tests
8535
dependsOn: Prebuild

.cirrus.yml renamed to .cirrus-DISABLED.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# gh-91960: Job disabled since Python is out of free credit (September 2023):
2+
# https://discuss.python.org/t/freebsd-gets-a-new-cirrus-ci-github-action-job-and-a-new-buildbot/33122/26
3+
14
freebsd_task:
25
freebsd_instance:
36
matrix:

Doc/c-api/intro.rst

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,30 @@ defined closer to where they are useful (e.g. :c:macro:`Py_RETURN_NONE`).
105105
Others of a more general utility are defined here. This is not necessarily a
106106
complete listing.
107107

108+
.. c:macro:: PyMODINIT_FUNC
109+
110+
Declare an extension module ``PyInit`` initialization function. The function
111+
return type is :c:expr:`PyObject*`. The macro declares any special linkage
112+
declarations required by the platform, and for C++ declares the function as
113+
``extern "C"``.
114+
115+
The initialization function must be named :samp:`PyInit_{name}`, where
116+
*name* is the name of the module, and should be the only non-\ ``static``
117+
item defined in the module file. Example::
118+
119+
static struct PyModuleDef spam_module = {
120+
PyModuleDef_HEAD_INIT,
121+
.m_name = "spam",
122+
...
123+
};
124+
125+
PyMODINIT_FUNC
126+
PyInit_spam(void)
127+
{
128+
return PyModule_Create(&spam_module);
129+
}
130+
131+
108132
.. c:macro:: Py_ABS(x)
109133
110134
Return the absolute value of ``x``.

Doc/library/dis.rst

Lines changed: 33 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1122,7 +1122,8 @@ iterations of the loop.
11221122
This bytecode distinguishes two cases: if ``STACK[-1]`` has a method with the
11231123
correct name, the bytecode pushes the unbound method and ``STACK[-1]``.
11241124
``STACK[-1]`` will be used as the first argument (``self``) by :opcode:`CALL`
1125-
when calling the unbound method. Otherwise, ``NULL`` and the object returned by
1125+
or :opcode:`CALL_KW` when calling the unbound method.
1126+
Otherwise, ``NULL`` and the object returned by
11261127
the attribute lookup are pushed.
11271128

11281129
.. versionchanged:: 3.12
@@ -1390,32 +1391,48 @@ iterations of the loop.
13901391

13911392
.. opcode:: CALL (argc)
13921393

1393-
Calls a callable object with the number of arguments specified by ``argc``,
1394-
including the named arguments specified by the preceding
1395-
:opcode:`KW_NAMES`, if any.
1396-
On the stack are (in ascending order), either:
1394+
Calls a callable object with the number of arguments specified by ``argc``.
1395+
On the stack are (in ascending order):
13971396

1398-
* NULL
13991397
* The callable
1400-
* The positional arguments
1401-
* The named arguments
1402-
1403-
or:
1404-
1405-
* The callable
1406-
* ``self``
1398+
* ``self`` or ``NULL``
14071399
* The remaining positional arguments
1408-
* The named arguments
14091400

1410-
``argc`` is the total of the positional and named arguments, excluding
1411-
``self`` when a ``NULL`` is not present.
1401+
``argc`` is the total of the positional arguments, excluding ``self``.
14121402

14131403
``CALL`` pops all arguments and the callable object off the stack,
14141404
calls the callable object with those arguments, and pushes the return value
14151405
returned by the callable object.
14161406

14171407
.. versionadded:: 3.11
14181408

1409+
.. versionchanged:: 3.13
1410+
The callable now always appears at the same position on the stack.
1411+
1412+
.. versionchanged:: 3.13
1413+
Calls with keyword arguments are now handled by :opcode:`CALL_KW`.
1414+
1415+
1416+
.. opcode:: CALL_KW (argc)
1417+
1418+
Calls a callable object with the number of arguments specified by ``argc``,
1419+
including one or more named arguments. On the stack are (in ascending order):
1420+
1421+
* The callable
1422+
* ``self`` or ``NULL``
1423+
* The remaining positional arguments
1424+
* The named arguments
1425+
* A :class:`tuple` of keyword argument names
1426+
1427+
``argc`` is the total of the positional and named arguments, excluding ``self``.
1428+
The length of the tuple of keyword argument names is the number of named arguments.
1429+
1430+
``CALL_KW`` pops all arguments, the keyword names, and the callable object
1431+
off the stack, calls the callable object with those arguments, and pushes the
1432+
return value returned by the callable object.
1433+
1434+
.. versionadded:: 3.13
1435+
14191436

14201437
.. opcode:: CALL_FUNCTION_EX (flags)
14211438

@@ -1441,15 +1458,6 @@ iterations of the loop.
14411458
.. versionadded:: 3.11
14421459

14431460

1444-
.. opcode:: KW_NAMES (consti)
1445-
1446-
Prefixes :opcode:`CALL`.
1447-
Stores a reference to ``co_consts[consti]`` into an internal variable
1448-
for use by :opcode:`CALL`. ``co_consts[consti]`` must be a tuple of strings.
1449-
1450-
.. versionadded:: 3.11
1451-
1452-
14531461
.. opcode:: MAKE_FUNCTION
14541462

14551463
Pushes a new function object on the stack built from the code object at ``STACK[1]``.

Doc/library/http.server.rst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -502,11 +502,24 @@ following command runs an HTTP/1.1 conformant server::
502502
Note that CGI scripts will be run with UID of user nobody, for security
503503
reasons. Problems with the CGI script will be translated to error 403.
504504

505+
.. deprecated-removed:: 3.13 3.15
506+
507+
:class:`CGIHTTPRequestHandler` is being removed in 3.15. CGI has not
508+
been considered a good way to do things for well over a decade. This code
509+
has been unmaintained for a while now and sees very little practical use.
510+
Retaining it could lead to further :ref:`security considerations
511+
<http.server-security>`.
512+
505513
:class:`CGIHTTPRequestHandler` can be enabled in the command line by passing
506514
the ``--cgi`` option::
507515

508516
python -m http.server --cgi
509517

518+
.. deprecated-removed:: 3.13 3.15
519+
520+
:mod:`http.server` command line ``--cgi`` support is being removed
521+
because :class:`CGIHTTPRequestHandler` is being removed.
522+
510523
.. _http.server-security:
511524

512525
Security Considerations

Doc/library/superseded.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,6 @@ backwards compatibility. They have been superseded by other modules.
99

1010

1111
.. toctree::
12+
:maxdepth: 1
1213

1314
optparse.rst

0 commit comments

Comments
 (0)