Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
3d8c38f
GH-135904: Improve the JIT's performance on macOS (GH-136528)
brandtbucher Jul 14, 2025
d995922
gh-136396: Include instrumentation when creating new copies of the by…
mpage Jul 14, 2025
9363703
gh-116738: Make grp module thread-safe (#135434)
yoney Jul 14, 2025
a104f8a
Adapt @hugovk's proof-of-concept CI definition refactor
WillChilds-Klein Jul 14, 2025
3fcbe0d
Preliminary refactor of multissltests.py, TODO migrate to classes
WillChilds-Klein Jul 14, 2025
5d8ec9a
Fix aws-lc/awslc lib name discrepancy
WillChilds-Klein Jul 14, 2025
991c6b2
Migrate AbstractBuilder to abc
WillChilds-Klein Jul 14, 2025
7b51499
Fix imports
WillChilds-Klein Jul 14, 2025
db20324
Fix a minor indentation error (#136661)
gaogaotiantian Jul 15, 2025
e4654e0
gh-136663: fix signatures of PyFloat_Pack/Unpack in docs (#136664)
skirpichev Jul 15, 2025
f320c95
gh-131189: Fix "msvcrt" import warning on Linux when "_ctypes" is not…
plashchynski Jul 15, 2025
c89a66f
GH-133711: Enable UTF-8 mode by default (PEP 686) (#133712)
AA-Turner Jul 15, 2025
5b969fd
GH-132661: Add ``string.templatelib.convert()`` (#135217)
AA-Turner Jul 15, 2025
a02cf19
gh-72570: mention the incompatibility of XOFs with HMAC (#136676)
picnixz Jul 15, 2025
624bf52
gh-136155: Docs: check for EPUB fatal errors in CI (#134074)
m-aciek Jul 15, 2025
7e10a10
gh-136682: Remove incorrect statement that `os.path.samestat` accepts…
bluetech Jul 15, 2025
a8f42e6
gh-111968: remove redundant fetching of interpreter state in `dict` i…
kumaraditya303 Jul 15, 2025
be02e68
gh-72327: Suggest using system terminal for pip install in PyREPL (#1…
ichard26 Jul 15, 2025
2500eb9
gh-135909: Assert incoming `refcnt != 0` for the free threaded GC (GH…
andrewreds Jul 15, 2025
7689407
Fix index entry and anchor for module.__test__ (GH-136674)
serhiy-storchaka Jul 15, 2025
cb59eae
Fix the doctest.testmod() docstring (GH-136675)
serhiy-storchaka Jul 15, 2025
e81c4e8
gh-127146: Report uid in Emscripten + node as native uid (#136509)
hoodmane Jul 16, 2025
e89923d
fix grammar typo in `logging.rst` (#136584)
wjandrea Jul 16, 2025
ef66fb5
gh-135148: Correctly handle f/t strings with comments and debug expre…
pablogsal Jul 16, 2025
8e2f4b4
Improved venv docs to indicate that isolation is the default. (#136698)
facundobatista Jul 16, 2025
12e52ca
gh-127146: Emscripten: Make os.umask() actually work (#136706)
hoodmane Jul 16, 2025
c730952
gh-127146: Emscripten: more regular stack overflow skips (#136708)
hoodmane Jul 16, 2025
2f0db9b
Add `.gram` file to the `.editorconfig` (#136680)
sobolevn Jul 16, 2025
bde808a
gh-136710: Fix bad indentation in `os.chdir` docstring (GH-136709)
haampie Jul 16, 2025
dcd27aa
gh-127146: Emscripten: Don't need to avoid unpaired surrogate anymore…
hoodmane Jul 16, 2025
69d8fe5
gh-126548: Add a thread-unsafety warning for `importlib.reload()` (GH…
johnslavik Jul 16, 2025
b7d7225
gh-136669: build `_asyncio` as static module (#136670)
kumaraditya303 Jul 16, 2025
180b3eb
fix traceback.FrameSummary docstring by adding end_lineno, colno, and…
olehermanse Jul 16, 2025
6638127
Complete ABC refactor
WillChilds-Klein Jul 16, 2025
4e0a8ca
Colorize parser
WillChilds-Klein Jul 16, 2025
1a90e0c
Adjust compatibility comment
WillChilds-Klein Jul 16, 2025
1fcb49f
📜🤖 Added by blurb_it.
blurb-it[bot] Jul 16, 2025
dd969fb
Revert "📜🤖 Added by blurb_it."
WillChilds-Klein Jul 16, 2025
1edce1c
Merge branch 'main' into refactor-ssl-tests
WillChilds-Klein Jul 16, 2025
3343120
Include old versions when using default versions
WillChilds-Klein Jul 16, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
root = true

[*.{py,c,cpp,h,js,rst,md,yml,yaml}]
[*.{py,c,cpp,h,js,rst,md,yml,yaml,gram}]
trim_trailing_whitespace = true
insert_final_newline = true
indent_style = space

[*.{py,c,cpp,h}]
[*.{py,c,cpp,h,gram}]
indent_size = 4

[*.rst]
Expand Down
131 changes: 34 additions & 97 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -260,84 +260,28 @@ jobs:
free-threading: ${{ matrix.free-threading }}
os: ${{ matrix.os }}

build-ubuntu-ssltests-openssl:
name: 'Ubuntu SSL tests with OpenSSL'
build-ubuntu-ssltests:
name: 'Ubuntu SSL tests'
runs-on: ${{ matrix.os }}
timeout-minutes: 60
needs: build-context
if: needs.build-context.outputs.run-tests == 'true'
strategy:
fail-fast: false
matrix:
os: [ubuntu-24.04]
openssl_ver: [3.0.16, 3.1.8, 3.2.4, 3.3.3, 3.4.1]
include:
- { os: ubuntu-24.04, ssl: openssl, ssl_ver: 3.0.16 }
- { os: ubuntu-24.04, ssl: openssl, ssl_ver: 3.1.8 }
- { os: ubuntu-24.04, ssl: openssl, ssl_ver: 3.2.4 }
- { os: ubuntu-24.04, ssl: openssl, ssl_ver: 3.3.3 }
- { os: ubuntu-24.04, ssl: openssl, ssl_ver: 3.4.1 }
- { os: ubuntu-24.04, ssl: awslc, ssl_ver: 1.55.0 }
# See Tools/ssl/make_ssl_data.py for notes on adding a new version
env:
OPENSSL_VER: ${{ matrix.openssl_ver }}
MULTISSL_DIR: ${{ github.workspace }}/multissl
OPENSSL_DIR: ${{ github.workspace }}/multissl/openssl/${{ matrix.openssl_ver }}
LD_LIBRARY_PATH: ${{ github.workspace }}/multissl/openssl/${{ matrix.openssl_ver }}/lib
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- name: Runner image version
run: echo "IMAGE_OS_VERSION=${ImageOS}-${ImageVersion}" >> "$GITHUB_ENV"
- name: Restore config.cache
uses: actions/cache@v4
with:
path: config.cache
key: ${{ github.job }}-${{ env.IMAGE_OS_VERSION }}-${{ needs.build-context.outputs.config-hash }}
- name: Register gcc problem matcher
run: echo "::add-matcher::.github/problem-matchers/gcc.json"
- name: Install dependencies
run: sudo ./.github/workflows/posix-deps-apt.sh
- name: Configure OpenSSL env vars
run: |
echo "MULTISSL_DIR=${GITHUB_WORKSPACE}/multissl" >> "$GITHUB_ENV"
echo "OPENSSL_DIR=${GITHUB_WORKSPACE}/multissl/openssl/${OPENSSL_VER}" >> "$GITHUB_ENV"
echo "LD_LIBRARY_PATH=${GITHUB_WORKSPACE}/multissl/openssl/${OPENSSL_VER}/lib" >> "$GITHUB_ENV"
- name: 'Restore OpenSSL build'
id: cache-openssl
uses: actions/cache@v4
with:
path: ./multissl/openssl/${{ env.OPENSSL_VER }}
key: ${{ matrix.os }}-multissl-openssl-${{ env.OPENSSL_VER }}
- name: Install OpenSSL
if: steps.cache-openssl.outputs.cache-hit != 'true'
run: python3 Tools/ssl/multissltests.py --steps=library --base-directory "$MULTISSL_DIR" --openssl "$OPENSSL_VER" --system Linux
- name: Add ccache to PATH
run: |
echo "PATH=/usr/lib/ccache:$PATH" >> "$GITHUB_ENV"
- name: Configure ccache action
uses: hendrikmuhs/ccache-action@v1.2
with:
save: false
- name: Configure CPython
run: ./configure CFLAGS="-fdiagnostics-format=json" --config-cache --enable-slower-safety --with-pydebug --with-openssl="$OPENSSL_DIR"
- name: Build CPython
run: make -j4
- name: Display build info
run: make pythoninfo
- name: SSL tests
run: ./python Lib/test/ssltests.py

build-ubuntu-ssltests-awslc:
name: 'Ubuntu SSL tests with AWS-LC'
runs-on: ${{ matrix.os }}
timeout-minutes: 60
needs: build-context
if: needs.build-context.outputs.run-tests == 'true'
strategy:
fail-fast: false
matrix:
os: [ubuntu-24.04]
awslc_ver: [1.55.0]
env:
AWSLC_VER: ${{ matrix.awslc_ver}}
SSL_VER: ${{ matrix.ssl_ver }}
MULTISSL_DIR: ${{ github.workspace }}/multissl
OPENSSL_DIR: ${{ github.workspace }}/multissl/aws-lc/${{ matrix.awslc_ver }}
LD_LIBRARY_PATH: ${{ github.workspace }}/multissl/aws-lc/${{ matrix.awslc_ver }}/lib
SSL_DIR: ${{ github.workspace }}/multissl/${{ matrix.ssl }}/${{ matrix.ssl_ver }}
LD_LIBRARY_PATH: ${{ github.workspace }}/multissl/${{ matrix.ssl }}/${{ matrix.ssl_ver }}/lib
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -356,22 +300,18 @@ jobs:
- name: Configure SSL lib env vars
run: |
echo "MULTISSL_DIR=${GITHUB_WORKSPACE}/multissl" >> "$GITHUB_ENV"
echo "OPENSSL_DIR=${GITHUB_WORKSPACE}/multissl/aws-lc/${AWSLC_VER}" >> "$GITHUB_ENV"
echo "LD_LIBRARY_PATH=${GITHUB_WORKSPACE}/multissl/aws-lc/${AWSLC_VER}/lib" >> "$GITHUB_ENV"
- name: 'Restore AWS-LC build'
id: cache-aws-lc
echo "SSL_DIR=${GITHUB_WORKSPACE}/multissl/${{ matrix.ssl }}/${SSL_VER}" >> "$GITHUB_ENV"
echo "LD_LIBRARY_PATH=${GITHUB_WORKSPACE}/multissl/${{ matrix.ssl }}/${SSL_VER}/lib" >> "$GITHUB_ENV"
- name: 'Restore SSL build'
id: cache-ssl
uses: actions/cache@v4
with:
path: ./multissl/aws-lc/${{ matrix.awslc_ver }}
key: ${{ matrix.os }}-multissl-aws-lc-${{ matrix.awslc_ver }}
- name: Install AWS-LC
if: steps.cache-aws-lc.outputs.cache-hit != 'true'
path: ./multissl/${{ env.SSL }}/${{ env.SSL_VER }}
key: ${{ matrix.os }}-multissl-${{ env.SSL }}-${{ env.SSL_VER }}
- name: Install SSL
if: steps.cache-ssl.outputs.cache-hit != 'true'
run: |
python3 Tools/ssl/multissltests.py \
--steps=library \
--base-directory "$MULTISSL_DIR" \
--awslc ${{ matrix.awslc_ver }} \
--system Linux
python3 Tools/ssl/multissltests.py --steps=library --base-directory "$MULTISSL_DIR" --system Linux --ssl ${{ matrix.ssl }} --ssl-versions ${{ matrix.ssl_ver }}
- name: Add ccache to PATH
run: |
echo "PATH=/usr/lib/ccache:$PATH" >> "$GITHUB_ENV"
Expand All @@ -381,18 +321,18 @@ jobs:
save: false
- name: Configure CPython
run: |
./configure CFLAGS="-fdiagnostics-format=json" \
--config-cache \
--enable-slower-safety \
--with-pydebug \
--with-openssl="$OPENSSL_DIR" \
--with-builtin-hashlib-hashes=blake2 \
--with-ssl-default-suites=openssl
CMD=(./configure CFLAGS="-fdiagnostics-format=json" --config-cache --enable-slower-safety --with-pydebug --with-openssl="$SSL_DIR")
if [ "${{ matrix.ssl }}" = "openssl" ]; then
"${CMD[@]}"
else
"${CMD[@]}" --with-builtin-hashlib-hashes=blake2 --with-ssl-default-suites=openssl
fi
- name: Build CPython
run: make -j
run: make -j4
- name: Display build info
run: make pythoninfo
- name: Verify python is linked to AWS-LC
if: matrix.ssl == 'aws-lc'
run: ./python -c 'import ssl; print(ssl.OPENSSL_VERSION)' | grep AWS-LC
- name: SSL tests
run: ./python Lib/test/ssltests.py
Expand Down Expand Up @@ -435,7 +375,7 @@ jobs:
key: ${{ runner.os }}-multissl-openssl-${{ env.OPENSSL_VER }}
- name: Install OpenSSL
if: steps.cache-openssl.outputs.cache-hit != 'true'
run: python3 Tools/ssl/multissltests.py --steps=library --base-directory "$MULTISSL_DIR" --openssl "$OPENSSL_VER" --system Linux
run: python3 Tools/ssl/multissltests.py --steps=library --base-directory "$MULTISSL_DIR" --ssl 'openssl' --ssl-versions "$OPENSSL_VER" --system Linux
- name: Add ccache to PATH
run: |
echo "PATH=/usr/lib/ccache:$PATH" >> "$GITHUB_ENV"
Expand Down Expand Up @@ -567,7 +507,7 @@ jobs:
key: ${{ matrix.os }}-multissl-openssl-${{ env.OPENSSL_VER }}
- name: Install OpenSSL
if: steps.cache-openssl.outputs.cache-hit != 'true'
run: python3 Tools/ssl/multissltests.py --steps=library --base-directory "$MULTISSL_DIR" --openssl "$OPENSSL_VER" --system Linux
run: python3 Tools/ssl/multissltests.py --steps=library --base-directory "$MULTISSL_DIR" --ssl 'openssl' --ssl-versions "$OPENSSL_VER" --system Linux
- name: Add ccache to PATH
run: |
echo "PATH=/usr/lib/ccache:$PATH" >> "$GITHUB_ENV"
Expand Down Expand Up @@ -703,8 +643,7 @@ jobs:
- build-windows-msi
- build-macos
- build-ubuntu
- build-ubuntu-ssltests-awslc
- build-ubuntu-ssltests-openssl
- build-ubuntu-ssltests
- build-wasi
- test-hypothesis
- build-asan
Expand All @@ -719,8 +658,7 @@ jobs:
with:
allowed-failures: >-
build-windows-msi,
build-ubuntu-ssltests-awslc,
build-ubuntu-ssltests-openssl,
build-ubuntu-ssltests,
test-hypothesis,
cifuzz,
allowed-skips: >-
Expand All @@ -738,8 +676,7 @@ jobs:
check-generated-files,
build-macos,
build-ubuntu,
build-ubuntu-ssltests-awslc,
build-ubuntu-ssltests-openssl,
build-ubuntu-ssltests,
build-wasi,
test-hypothesis,
build-asan,
Expand Down
14 changes: 13 additions & 1 deletion .github/workflows/reusable-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ jobs:
run: |
set -Eeuo pipefail
# Build docs with the nit-picky option; write warnings to file
make -C Doc/ PYTHON=../python SPHINXOPTS="--quiet --nitpicky --fail-on-warning --warning-file sphinx-warnings.txt" html
make -C Doc/ PYTHON=../python SPHINXOPTS="--quiet --nitpicky --warning-file sphinx-warnings.txt" html
- name: 'Check warnings'
if: github.event_name == 'pull_request'
run: |
Expand All @@ -75,6 +75,18 @@ jobs:
--fail-if-regression \
--fail-if-improved \
--fail-if-new-news-nit
- name: 'Build EPUB documentation'
continue-on-error: true
run: |
set -Eeuo pipefail
make -C Doc/ PYTHON=../python SPHINXOPTS="--quiet" epub
pip install epubcheck
epubcheck Doc/build/epub/Python.epub &> Doc/epubcheck.txt
- name: 'Check for fatal errors in EPUB'
if: github.event_name == 'pull_request'
continue-on-error: true # until gh-136155 is fixed
run: |
python Doc/tools/check-epub.py

# Run "doctest" on HEAD as new syntax doesn't exist in the latest stable release
doctest:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/reusable-ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ jobs:
key: ${{ inputs.os }}-multissl-openssl-${{ env.OPENSSL_VER }}
- name: Install OpenSSL
if: steps.cache-openssl.outputs.cache-hit != 'true'
run: python3 Tools/ssl/multissltests.py --steps=library --base-directory "$MULTISSL_DIR" --openssl "$OPENSSL_VER" --system Linux
run: python3 Tools/ssl/multissltests.py --steps=library --base-directory "$MULTISSL_DIR" --ssl openssl --ssl-versions "$OPENSSL_VER" --system Linux
- name: Add ccache to PATH
run: |
echo "PATH=/usr/lib/ccache:$PATH" >> "$GITHUB_ENV"
Expand Down
12 changes: 6 additions & 6 deletions Doc/c-api/float.rst
Original file line number Diff line number Diff line change
Expand Up @@ -124,15 +124,15 @@ There are two problems on non-IEEE platforms:
* What this does is undefined if *x* is a NaN or infinity.
* ``-0.0`` and ``+0.0`` produce the same bytes string.

.. c:function:: int PyFloat_Pack2(double x, unsigned char *p, int le)
.. c:function:: int PyFloat_Pack2(double x, char *p, int le)

Pack a C double as the IEEE 754 binary16 half-precision format.

.. c:function:: int PyFloat_Pack4(double x, unsigned char *p, int le)
.. c:function:: int PyFloat_Pack4(double x, char *p, int le)

Pack a C double as the IEEE 754 binary32 single precision format.

.. c:function:: int PyFloat_Pack8(double x, unsigned char *p, int le)
.. c:function:: int PyFloat_Pack8(double x, char *p, int le)

Pack a C double as the IEEE 754 binary64 double precision format.

Expand All @@ -154,14 +154,14 @@ Return value: The unpacked double. On error, this is ``-1.0`` and
Note that on a non-IEEE platform this will refuse to unpack a bytes string that
represents a NaN or infinity.

.. c:function:: double PyFloat_Unpack2(const unsigned char *p, int le)
.. c:function:: double PyFloat_Unpack2(const char *p, int le)

Unpack the IEEE 754 binary16 half-precision format as a C double.

.. c:function:: double PyFloat_Unpack4(const unsigned char *p, int le)
.. c:function:: double PyFloat_Unpack4(const char *p, int le)

Unpack the IEEE 754 binary32 single precision format as a C double.

.. c:function:: double PyFloat_Unpack8(const unsigned char *p, int le)
.. c:function:: double PyFloat_Unpack8(const char *p, int le)

Unpack the IEEE 754 binary64 double precision format as a C double.
4 changes: 1 addition & 3 deletions Doc/c-api/init_config.rst
Original file line number Diff line number Diff line change
Expand Up @@ -975,9 +975,7 @@ PyPreConfig
Set to ``0`` or ``1`` by the :option:`-X utf8 <-X>` command line option
and the :envvar:`PYTHONUTF8` environment variable.

Also set to ``1`` if the ``LC_CTYPE`` locale is ``C`` or ``POSIX``.

Default: ``-1`` in Python config and ``0`` in isolated config.
Default: ``1``.


.. _c-preinit:
Expand Down
1 change: 1 addition & 0 deletions Doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,7 @@

epub_author = 'Python Documentation Authors'
epub_publisher = 'Python Software Foundation'
epub_exclude_files = ('index.xhtml', 'download.xhtml')

# index pages are not valid xhtml
# https://github.com/sphinx-doc/sphinx/issues/12359
Expand Down
4 changes: 4 additions & 0 deletions Doc/library/doctest.rst
Original file line number Diff line number Diff line change
Expand Up @@ -311,9 +311,13 @@ Which Docstrings Are Examined?
The module docstring, and all function, class and method docstrings are
searched. Objects imported into the module are not searched.

.. currentmodule:: None

.. attribute:: module.__test__
:no-typesetting:

.. currentmodule:: doctest

In addition, there are cases when you want tests to be part of a module but not part
of the help text, which requires that the tests not be included in the docstring.
Doctest looks for a module-level variable called ``__test__`` and uses it to locate other
Expand Down
3 changes: 3 additions & 0 deletions Doc/library/hmac.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
--------------

This module implements the HMAC algorithm as described by :rfc:`2104`.
The interface allows to use any hash function with a *fixed* digest size.
In particular, extendable output functions such as SHAKE-128 or SHAKE-256
cannot be used with HMAC.


.. function:: new(key, msg=None, digestmod)
Expand Down
4 changes: 4 additions & 0 deletions Doc/library/importlib.rst
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,10 @@ Functions
:exc:`ModuleNotFoundError` is raised when the module being reloaded lacks
a :class:`~importlib.machinery.ModuleSpec`.

.. warning::
This function is not thread-safe. Calling it from multiple threads can result
in unexpected behavior. It's recommended to use the :class:`threading.Lock`
or other synchronization primitives for thread-safe module reloading.

:mod:`importlib.abc` -- Abstract base classes related to import
---------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion Doc/library/logging.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1317,7 +1317,7 @@ functions.
In Python versions earlier than 3.4, this function could also be passed a
text level, and would return the corresponding numeric value of the level.
This undocumented behaviour was considered a mistake, and was removed in
Python 3.4, but reinstated in 3.4.2 due to retain backward compatibility.
Python 3.4, but reinstated in 3.4.2 in order to retain backward compatibility.

.. function:: getHandlerByName(name)

Expand Down
3 changes: 0 additions & 3 deletions Doc/library/os.path.rst
Original file line number Diff line number Diff line change
Expand Up @@ -508,9 +508,6 @@ the :mod:`glob` module.)
.. versionchanged:: 3.4
Added Windows support.

.. versionchanged:: 3.6
Accepts a :term:`path-like object`.


.. function:: split(path)

Expand Down
Loading
Loading