8000 Merge remote-tracking branch 'upstream/main' into ft-deque-clinic · python/cpython@60b6346 · GitHub
[go: up one dir, main page]

Skip to content

Commit 60b6346

Browse files
committed
Merge remote-tracking branch 'upstream/main' into ft-deque-clinic
2 parents 2f9c90a + b4d4aa9 commit 60b6346

File tree

487 files changed

+14199
-19499
lines changed
  • test_json
  • test_module
  • test_pathlib
  • test_tkinter
  • test_tools
  • test_unittest
  • test_zipfile
  • test_zoneinfo
  • tkinter
  • unittest
  • zipfile
  • Misc
  • Some content is hidden

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

    487 files changed

    +14199
    -19499
    lines changed

    .cirrus-DISABLED.yml

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

    .gitattributes

    Lines changed: 0 additions & 1 deletion
    Original file line numberDiff line numberDiff line change
    @@ -94,7 +94,6 @@ Programs/test_frozenmain.h generated
    9494
    Python/Python-ast.c generated
    9595
    Python/executor_cases.c.h generated
    9696
    Python/generated_cases.c.h generated
    97-
    Python/abstract_interp_cases.c.h generated
    9897
    Python/opcode_targets.h generated
    9998
    Python/stdlib_module_names.h generated
    10099
    Tools/peg_generator/pegen/grammar_parser.py generated

    .github/CODEOWNERS

    Lines changed: 2 additions & 0 deletions
    Original file line numberDiff line numberDiff line change
    @@ -157,6 +157,8 @@ Doc/c-api/stable.rst @encukou
    157157

    158158
    **/*dataclasses* @ericvsmith
    159159

    160+
    **/*ensurepip* @pfmoore @pradyunsg
    161+
    160162
    **/*idlelib* @terryjreedy
    161163

    162164
    **/*typing* @JelleZijlstra @AlexWaygood

    .github/workflows/build.yml

    Lines changed: 26 additions & 18 deletions
    Original file line numberDiff line numberDiff line change
    @@ -128,7 +128,7 @@ jobs:
    128128
    if: needs.check_source.outputs.run_tests == 'true'
    129129
    steps:
    130130
    - uses: actions/checkout@v4
    131-
    - uses: actions/setup-python@v4
    131+
    - uses: actions/setup-python@v5
    132132
    with:
    133133
    python-version: '3.x'
    134134
    - name: Restore config.cache
    @@ -142,6 +142,8 @@ jobs:
    142142
    run: echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV
    143143
    - name: Configure ccache action
    144144
    uses: hendrikmuhs/ccache-action@v1.2
    145+
    with:
    146+
    save: ${{ github.event_name == 'push' }}
    145147
    - name: Check Autoconf and aclocal versions
    146148
    run: |
    147149
    grep "Generated by GNU Autoconf 2.71" configure
    @@ -187,13 +189,13 @@ jobs:
    187189
    if: needs.check_source.outputs.run_tests == 'true'
    188190
    uses: ./.github/workflows/reusable-windows.yml
    189191

    190-
    build_windows_free_threaded:
    191-
    name: 'Windows (free-threaded)'
    192+
    build_windows_free_threading:
    193+
    name: 'Windows (free-threading)'
    192194
    needs: check_source
    193195
    if: needs.check_source.outputs.run_tests == 'true'
    194196
    uses: ./.github/workflows/reusable-windows.yml
    195197
    with:
    196-
    free-threaded: true
    198+
    free-threading: true
    197199

    198200
    build_macos:
    199201
    name: 'macOS'
    @@ -203,14 +205,14 @@ jobs:
    203205
    with:
    204206
    config_hash: ${{ needs.check_source.outputs.config_hash }}
    205207

    206-
    build_macos_free_threaded:
    207-
    name: 'macOS (free-threaded)'
    208+
    build_macos_free_threading:
    209+
    name: 'macOS (free-threading)'
    208210
    needs: check_source
    209211
    if: needs.check_source.outputs.run_tests == 'true'
    210212
    uses: ./.github/workflows/reusable-macos.yml
    211213
    with:
    212214
    config_hash: ${{ needs.check_source.outputs.config_hash }}
    213-
    free-threaded: true
    215+
    free-threading: true
    214216

    215217
    build_ubuntu:
    216218
    name: 'Ubuntu'
    @@ -225,8 +227,8 @@ jobs:
    225227
    --with-pydebug \
    226228
    --with-openssl=$OPENSSL_DIR
    227229
    228-
    build_ubuntu_free_threaded:
    229-
    name: 'Ubuntu (free-threaded)'
    230+
    build_ubuntu_free_threading:
    231+
    name: 'Ubuntu (free-threading)'
    230232
    needs: check_source
    231233
    if: needs.check_source.outputs.run_tests == 'true'
    232234
    uses: ./.github/workflows/reusable-ubuntu.yml
    @@ -284,6 +286,8 @@ jobs:
    284286
    echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV
    285287
    - name: Configure ccache action
    286288
    uses: hendrikmuhs/ccache-action@v1.2
    289+
    with:
    290+
    save: ${{ github.event_name == 'push' }}
    287291
    - name: Configure CPython
    288292
    run: ./configure --config-cache --with-pydebug --with-openssl=$OPENSSL_DIR
    289293
    - name: Build CPython
    @@ -327,6 +331,8 @@ jobs:
    327331
    echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV
    328332
    - name: Configure ccache action
    329333
    uses: hendrikmuhs/ccache-action@v1.2
    334+
    with:
    335+
    save: ${{ github.event_name == 'push' }}
    330336
    - name: Setup directory envs for out-of-tree builds
    331337
    run: |
    332338
    echo "CPYTHON_RO_SRCDIR=$(realpath -m ${GITHUB_WORKSPACE}/../cpython-ro-srcdir)" >> $GITHUB_ENV
    @@ -395,7 +401,7 @@ jobs:
    395401
    -x test_subprocess \
    396402
    -x test_signal \
    397403
    -x test_sysconfig
    398-
    - uses: actions/upload-artifact@v3
    404+
    - uses: actions/upload-artifact@v4
    399405
    if: always()
    400406
    with:
    401407
    name: hypothesis-example-db
    @@ -446,6 +452,8 @@ jobs:
    446452
    echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV
    447453
    - name: Configure ccache action
    448454
    uses: hendrikmuhs/ccache-action@v1.2
    455+
    with:
    456+
    save: ${{ github.event_name == 'push' }}
    449457
    - name: Configure CPython
    450458
    run: ./configure --config-cache --with-address-sanitizer --without-pymalloc
    451459
    - name: Build CPython
    @@ -483,14 +491,14 @@ jobs:
    483491
    output-sarif: true
    484492
    sanitizer: ${{ matrix.sanitizer }}
    485493
    - name: Upload crash
    486-
    uses: actions/upload-artifact@v3
    494+
    uses: actions/upload-artifact@v4
    487495
    if: failure() && steps.build.outcome == 'success'
    488496
    with:
    489497
    name: ${{ matrix.sanitizer }}-artifacts
    490498
    path: ./out/artifacts
    491499
    - name: Upload SARIF
    492500
    if: always() && steps.build.outcome == 'success'
    493-
    uses: github/codeql-action/upload-sarif@v2
    501+
    uses: github/codeql-action/upload-sarif@v3
    494502
    with:
    495503
    sarif_file: cifuzz-sarif/results.sarif
    496504
    checkout_path: cifuzz-sarif
    @@ -504,12 +512,12 @@ jobs:
    504512
    - check-docs
    505513
    - check_generated_files
    506514
    - build_macos
    507-
    - build_macos_free_threaded
    515+
    - build_macos_free_threading
    508516
    - build_ubuntu
    509-
    - build_ubuntu_free_threaded
    517+
    - build_ubuntu_free_threading
    510518
    - build_ubuntu_ssltests
    511519
    - build_windows
    512-
    - build_windows_free_threaded
    520+
    - build_windows_free_threading
    513521
    - test_hypothesis
    514522
    - build_asan
    515523
    - cifuzz
    @@ -537,12 +545,12 @@ jobs:
    537545
    && '
    538546
    check_generated_files,
    539547
    build_macos,
    540-
    build_macos_free_threaded,
    548+
    build_macos_free_threading,
    541549
    build_ubuntu,
    542-
    build_ubuntu_free_threaded,
    550+
    build_ubuntu_free_threading,
    543551
    build_ubuntu_ssltests,
    544552
    build_windows,
    545-
    build_windows_free_threaded,
    553+
    build_windows_free_threading,
    546554
    build_asan,
    547555
    '
    548556
    || ''

    .github/workflows/lint.yml

    Lines changed: 1 addition & 1 deletion
    Original file line numberDiff line numberDiff line change
    @@ -20,7 +20,7 @@ jobs:
    2020

    2121
    steps:
    2222
    - uses: actions/checkout@v4
    23-
    - uses: actions/setup-python@v4
    23+
    - uses: actions/setup-python@v5
    2424
    with:
    2525
    python-version: "3.x"
    2626
    - uses: pre-commit/action@v3.0.0

    .github/workflows/mypy.yml

    Lines changed: 1 addition & 1 deletion
    Original file line numberDiff line numberDiff line change
    @@ -46,7 +46,7 @@ jobs:
    4646
    timeout-minutes: 10
    4747
    steps:
    4848
    - uses: actions/checkout@v4
    49-
    - uses: actions/setup-python@v4
    49+
    - uses: actions/setup-python@v5
    5050
    with:
    5151
    python-version: "3.11"
    5252
    cache: pip

    .github/workflows/reusable-docs.yml

    Lines changed: 2 additions & 2 deletions
    Original file line numberDiff line numberDiff line change
    @@ -41,7 +41,7 @@ jobs:
    4141
    git fetch origin ${{ env.refspec_base }} --shallow-since="${DATE}" \
    4242
    --no-tags --prune --no-recurse-submodules
    4343
    - name: 'Set up Python'
    44-
    uses: actions/setup-python@v4
    44+
    uses: actions/setup-python@v5
    4545
    with:
    4646
    python-version: '3'
    4747
    cache: 'pip'
    @@ -72,7 +72,7 @@ jobs:
    7272
    steps:
    7373
    - uses: actions/checkout@v4
    7474
    - name: 'Set up Python'
    75-
    uses: actions/setup-python@v4
    75+
    uses: actions/setup-python@v5
    7676
    with:
    7777
    python-version: '3.11' # known to work with Sphinx 4.2
    7878
    cache: 'pip'

    .github/workflows/reusable-macos.yml

    < 10000 button class="Button Button--iconOnly Button--invisible flex-shrink-0 js-expand-all-difflines-button" aria-label="Expand all lines: .github/workflows/reusable-macos.yml" data-file-path=".github/workflows/reusable-macos.yml" aria-describedby=":R4dkdlab:">
    Lines changed: 2 additions & 2 deletions
    Original file line numberDiff line numberDiff line change
    @@ -4,7 +4,7 @@ on:
    44
    config_hash:
    55
    required: true
    66
    type: string
    7-
    free-threaded:
    7+
    free-threading:
    88
    required: false
    99
    type: boolean
    1010
    default: false
    @@ -35,7 +35,7 @@ jobs:
    3535
    ./configure \
    3636
    --config-cache \
    3737
    --with-pydebug \
    38-
    ${{ inputs.free-threaded && '--disable-gil' || '' }} \
    38+
    ${{ inputs.free-threading && '--disable-gil' || '' }} \
    3939
    --prefix=/opt/python-dev \
    4040
    --with-openssl="$(brew --prefix openssl@3.0)"
    4141
    - name: Build CPython

    .github/workflows/reusable-ubuntu.yml

    Lines changed: 2 additions & 0 deletions
    Original file line numberDiff line numberDiff line change
    @@ -41,6 +41,8 @@ jobs:
    4141
    echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV
    4242
    - name: Configure ccache action
    4343
    uses: hendrikmuhs/ccache-action@v1.2
    44+
    with:
    45+
    save: ${{ github.event_name == 'push' }}
    4446
    - name: Setup directory envs for out-of-tree builds
    4547
    run: |
    4648
    echo "CPYTHON_RO_SRCDIR=$(realpath -m ${GITHUB_WORKSPACE}/../cpython-ro-srcdir)" >> $GITHUB_ENV

    .github/workflows/reusable-windows.yml

    Lines changed: 4 additions & 4 deletions
    Original file line numberDiff line numberDiff line change
    @@ -1,7 +1,7 @@
    11
    on:
    22
    workflow_call:
    33
    inputs:
    4-
    free-threaded:
    4+
    free-threading:
    55
    required: false
    66
    type: boolean
    77
    default: false
    @@ -16,7 +16,7 @@ jobs:
    1616
    steps:
    1717
    - uses: actions/checkout@v4
    1818
    - name: Build CPython
    19-
    run: .\PCbuild\build.bat -e -d -v -p Win32 ${{ inputs.free-threaded && '--disable-gil' || '' }}
    19+
    run: .\PCbuild\build.bat -e -d -v -p Win32 ${{ inputs.free-threading && '--disable-gil' || '' }}
    2020
    - name: Display build info
    2121
    run: .\python.bat -m test.pythoninfo
    2222
    - name: Tests
    @@ -33,7 +33,7 @@ jobs:
    3333
    - name: Register MSVC problem matcher
    3434
    run: echo "::add-matcher::.github/problem-matchers/msvc.json"
    3535
    - name: Build CPython
    36-
    run: .\PCbuild\build.bat -e -d -v -p x64 ${{ inputs.free-threaded && '--disable-gil' || '' }}
    36+
    run: .\PCbuild\build.bat -e -d -v -p x64 ${{ inputs.free-threading && '--disable-gil' || '' }}
    3737
    - name: Display build info
    3838
    run: .\python.bat -m test.pythoninfo
    3939
    - name: Tests
    @@ -50,4 +50,4 @@ jobs:
    5050
    - name: Register MSVC problem matcher
    5151
    run: echo "::add-matcher::.github/problem-matchers/msvc.json"
    5252
    - name: Build CPython
    53-
    run: .\PCbuild\build.bat -e -d -v -p arm64 ${{ inputs.free-threaded && '--disable-gil' || '' }}
    53+
    run: .\PCbuild\build.bat -e -d -v -p arm64 ${{ inputs.free-threading && '--disable-gil' || '' }}

    .github/workflows/stale.yml

    Lines changed: 1 addition & 1 deletion
    Original file line numberDiff line numberDiff line change
    @@ -16,7 +16,7 @@ jobs:
    1616

    1717
    steps:
    1818
    - name: "Check PRs"
    19-
    uses: actions/stale@v8
    19+
    uses: actions/stale@v9
    2020
    with:
    2121
    repo-token: ${{ secrets.GITHUB_TOKEN }}
    2222
    stale-pr-message: 'This PR is stale because it has been open for 30 days with no activity.'

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

    Lines changed: 1 addition & 1 deletion
    Original file line numberDiff line numberDiff line change
    @@ -26,7 +26,7 @@ jobs:
    2626
    timeout-minutes: 10
    2727
    steps:
    2828
    - uses: actions/checkout@v4
    29-
    - uses: actions/setup-python@v4
    29+
    - uses: actions/setup-python@v5
    3030
    with:
    3131
    python-version: '3'
    3232
    - name: Compare checksum of bundled wheels to the ones published on PyPI

    Doc/Makefile

    Lines changed: 7 additions & 3 deletions
    Original file line numberDiff line numberDiff line change
    @@ -19,8 +19,12 @@ SPHINXERRORHANDLING = -W
    1919
    PAPEROPT_a4 = -D latex_elements.papersize=a4paper
    2020
    PAPEROPT_letter = -D latex_elements.papersize=letterpaper
    2121

    22-
    ALLSPHINXOPTS = -b $(BUILDER) -d build/doctrees $(PAPEROPT_$(PAPER)) -j $(JOBS) \
    23-
    $(SPHINXOPTS) $(SPHINXERRORHANDLING) . build/$(BUILDER) $(SOURCES)
    22+
    ALLSPHINXOPTS = -b $(BUILDER) \
    23+
    -d build/doctrees \
    24+
    -j $(JOBS) \
    25+
    $(PAPEROPT_$(PAPER)) \
    26+
    $(SPHINXOPTS) $(SPHINXERRORHANDLING) \
    27+
    . build/$(BUILDER) $(SOURCES)
    2428

    2529
    .PHONY: help
    2630
    help:
    @@ -142,7 +146,7 @@ htmlview: html
    142146

    143147
    .PHONY: htmllive
    144148
    htmllive: SPHINXBUILD = $(VENVDIR)/bin/sphinx-autobuild
    145-
    htmllive: SPHINXOPTS = --re-ignore="/venv/"
    149+
    htmllive: SPHINXOPTS = --re-ignore="/venv/" --open-browser --delay 0
    146150
    htmllive: html
    147151

    148152
    .PHONY: clean

    Doc/c-api/exceptions.rst

    Lines changed: 1 addition & 1 deletion
    Original file line numberDiff line numberDiff line change
    @@ -440,7 +440,7 @@ Querying the error indicator
    440440
    .. c:function:: PyObject *PyErr_GetRaisedException(void)
    441441
    442442
    Return the exception currently being raised, clearing the error indicator at
    443-
    the same time.
    443+
    the same time. Return ``NULL`` if the error indicator is not set.
    444444
    445445
    This function is used by code that needs to catch exceptions,
    446446
    or code that needs to save and restore the error indicator temporarily.

    Doc/c-api/object.rst

    Lines changed: 2 additions & 3 deletions
    Original file line numberDiff line numberDiff line change
    @@ -47,9 +47,8 @@ Object Protocol
    4747
    4848
    .. c:function:: int PyObject_HasAttr(PyObject *o, PyObject *attr_name)
    4949
    50-
    Returns ``1`` if *o* has the attribute *attr_name*, and ``0`` otherwise. This
    51-
    is equivalent to the Python expression ``hasattr(o, attr_name)``. This function
    52-
    always succeeds.
    50+
    Returns ``1`` if *o* has the attribute *attr_name*, and ``0`` otherwise.
    51+
    This function always succeeds.
    5352
    5453
    .. note::
    5554

    Doc/data/refcounts.dat

    Lines changed: 7 additions & 0 deletions
    Original file line numberDiff line numberDiff line change
    @@ -1589,6 +1589,13 @@ PyObject_Call:PyObject*:callable_object:0:
    15891589
    PyObject_Call:PyObject*:args:0:
    15901590
    PyObject_Call:PyObject*:kw:0:
    15911591

    1592+
    PyObject_CallNoArgs:PyObject*::+1:
    1593+
    PyObject_CallNoArgs:PyObject*:callable_object:0:
    1594+
    1595+
    PyObject_CallOneArg:PyObject*::+1:
    1596+
    PyObject_CallOneArg:PyObject*:callable_object:0:
    1597+
    PyObject_CallOneArg:PyObject*:arg:0:
    1598+
    15921599
    PyObject_CallFunction:PyObject*::+1:
    15931600
    PyObject_CallFunction:PyObject*:callable_object:0:
    15941601
    PyObject_CallFunction:const char*:format::

    Doc/faq/design.rst

    Lines changed: 1 addition & 1 deletion
    Original file line numberDiff line numberDiff line change
    @@ -451,7 +451,7 @@ on the key and a per-process seed; for example, ``'Python'`` could hash to
    451451
    to ``1142331976``. The hash code is then used to calculate a location in an
    452452
    internal array where the value will be stored. Assuming that you're storing
    453453
    keys that all have different hash values, this means that dictionaries take
    454-
    constant time -- O(1), in Big-O notation -- to retrieve a key.
    454+
    constant time -- *O*\ (1), in Big-O notation -- to retrieve a key.
    455455

    456456

    457457
    Why must dictionary keys be immutable?

    Doc/glossary.rst

    Lines changed: 1 addition & 1 deletion
    Original file line numberDiff line numberDiff line change
    @@ -742,7 +742,7 @@ Glossary
    742742
    list
    743743
    A built-in Python :term:`sequence`. Despite its name it is more akin
    744744
    to an array in other languages than to a linked list since access to
    745-
    elements is O(1).
    745+
    elements is *O*\ (1).
    746746

    747747
    list comprehension
    748748
    A compact way to process all or part of the elements in a sequence and

    Doc/howto/descriptor.rst

    Lines changed: 1 addition & 1 deletion
    Original file line numberDiff line numberDiff line change
    @@ -1250,7 +1250,7 @@ instance::
    12501250
    <function D.f at 0x00C45070>
    12511251

    12521252
    >>> d.f.__self__
    1253-
    <__main__.D object at 0x1012e1f98>
    1253+
    <__main__.D object at 0x00B18C90>
    12541254

    12551255
    If you have ever wondered where *self* comes from in regular methods or where
    12561256
    *cls* comes from in class methods, this is it!

    0 commit comments

    Comments
     (0)
    0