Skip to content

Commit 30edb78

Browse files
authored
Merge branch 'main' into fix-issue-136535
2 parents 6050223 + 2301cdb commit 30edb78

Some content is hidden

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

54 files changed

+859
-223
lines changed

.github/workflows/build.yml

Lines changed: 82 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ jobs:
260260
free-threading: ${{ matrix.free-threading }}
261261
os: ${{ matrix.os }}
262262

263-
build-ubuntu-ssltests:
263+
build-ubuntu-ssltests-openssl:
264264
name: 'Ubuntu SSL tests with OpenSSL'
265265
runs-on: ${{ matrix.os }}
266266
timeout-minutes: 60
@@ -322,6 +322,81 @@ jobs:
322322
- name: SSL tests
323323
run: ./python Lib/test/ssltests.py
324324

325+
build-ubuntu-ssltests-awslc:
326+
name: 'Ubuntu SSL tests with AWS-LC'
327+
runs-on: ${{ matrix.os }}
328+
timeout-minutes: 60
329+
needs: build-context
330+
if: needs.build-context.outputs.run-tests == 'true'
331+
strategy:
332+
fail-fast: false
333+
matrix:
334+
os: [ubuntu-24.04]
335+
awslc_ver: [1.55.0]
336+
env:
337+
AWSLC_VER: ${{ matrix.awslc_ver}}
338+
MULTISSL_DIR: ${{ github.workspace }}/multissl
339+
OPENSSL_DIR: ${{ github.workspace }}/multissl/aws-lc/${{ matrix.awslc_ver }}
340+
LD_LIBRARY_PATH: ${{ github.workspace }}/multissl/aws-lc/${{ matrix.awslc_ver }}/lib
341+
steps:
342+
- uses: actions/checkout@v4
343+
with:
344+
persist-credentials: false
345+
- name: Runner image version
346+
run: echo "IMAGE_OS_VERSION=${ImageOS}-${ImageVersion}" >> "$GITHUB_ENV"
347+
- name: Restore config.cache
348+
uses: actions/cache@v4
349+
with:
350+
path: config.cache
351+
key: ${{ github.job }}-${{ env.IMAGE_OS_VERSION }}-${{ needs.build-context.outputs.config-hash }}
352+
- name: Register gcc problem matcher
353+
run: echo "::add-matcher::.github/problem-matchers/gcc.json"
354+
- name: Install dependencies
355+
run: sudo ./.github/workflows/posix-deps-apt.sh
356+
- name: Configure SSL lib env vars
357+
run: |
358+
echo "MULTISSL_DIR=${GITHUB_WORKSPACE}/multissl" >> "$GITHUB_ENV"
359+
echo "OPENSSL_DIR=${GITHUB_WORKSPACE}/multissl/aws-lc/${AWSLC_VER}" >> "$GITHUB_ENV"
360+
echo "LD_LIBRARY_PATH=${GITHUB_WORKSPACE}/multissl/aws-lc/${AWSLC_VER}/lib" >> "$GITHUB_ENV"
361+
- name: 'Restore AWS-LC build'
362+
id: cache-aws-lc
363+
uses: actions/cache@v4
364+
with:
365+
path: ./multissl/aws-lc/${{ matrix.awslc_ver }}
366+
key: ${{ matrix.os }}-multissl-aws-lc-${{ matrix.awslc_ver }}
367+
- name: Install AWS-LC
368+
if: steps.cache-aws-lc.outputs.cache-hit != 'true'
369+
run: |
370+
python3 Tools/ssl/multissltests.py \
371+
--steps=library \
372+
--base-directory "$MULTISSL_DIR" \
373+
--awslc ${{ matrix.awslc_ver }} \
374+
--system Linux
375+
- name: Add ccache to PATH
376+
run: |
377+
echo "PATH=/usr/lib/ccache:$PATH" >> "$GITHUB_ENV"
378+
- name: Configure ccache action
379+
uses: hendrikmuhs/[email protected]
380+
with:
381+
save: false
382+
- name: Configure CPython
383+
run: |
384+
./configure CFLAGS="-fdiagnostics-format=json" \
385+
--config-cache \
386+
--enable-slower-safety \
387+
--with-pydebug \
388+
--with-openssl="$OPENSSL_DIR" \
389+
--with-builtin-hashlib-hashes=blake2 \
390+
--with-ssl-default-suites=openssl
391+
- name: Build CPython
392+
run: make -j
393+
- name: Display build info
394+
run: make pythoninfo
395+
- name: Verify python is linked to AWS-LC
396+
run: ./python -c 'import ssl; print(ssl.OPENSSL_VERSION)' | grep AWS-LC
397+
- name: SSL tests
398+
run: ./python Lib/test/ssltests.py
399+
325400
build-wasi:
326401
name: 'WASI'
327402
needs: build-context
@@ -628,7 +703,8 @@ jobs:
628703
- build-windows-msi
629704
- build-macos
630705
- build-ubuntu
631-
- build-ubuntu-ssltests
706+
- build-ubuntu-ssltests-awslc
707+
- build-ubuntu-ssltests-openssl
632708
- build-wasi
633709
- test-hypothesis
634710
- build-asan
@@ -643,7 +719,8 @@ jobs:
643719
with:
644720
allowed-failures: >-
645721
build-windows-msi,
646-
build-ubuntu-ssltests,
722+
build-ubuntu-ssltests-awslc,
723+
build-ubuntu-ssltests-openssl,
647724
test-hypothesis,
648725
cifuzz,
649726
allowed-skips: >-
@@ -661,7 +738,8 @@ jobs:
661738
check-generated-files,
662739
build-macos,
663740
build-ubuntu,
664-
build-ubuntu-ssltests,
741+
build-ubuntu-ssltests-awslc,
742+
build-ubuntu-ssltests-openssl,
665743
build-wasi,
666744
test-hypothesis,
667745
build-asan,

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ apt-get -yq install \
55
build-essential \
66
pkg-config \
77
ccache \
8+
cmake \
89
gdb \
910
lcov \
1011
libb2-dev \

Doc/library/codecs.rst

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1395,7 +1395,11 @@ encodings.
13951395
| | | It is used in the Python |
13961396
| | | pickle protocol. |
13971397
+--------------------+---------+---------------------------+
1398-
| undefined | | Raise an exception for |
1398+
| undefined | | This Codec should only |
1399+
| | | be used for testing |
1400+
| | | purposes. |
1401+
| | | |
1402+
| | | Raise an exception for |
13991403
| | | all conversions, even |
14001404
| | | empty strings. The error |
14011405
| | | handler is ignored. |

Doc/library/email.parser.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ methods.
4848
FeedParser API
4949
^^^^^^^^^^^^^^
5050

51-
The :class:`BytesFeedParser`, imported from the :mod:`email.feedparser` module,
52-
provides an API that is conducive to incremental parsing of email messages,
51+
The :class:`BytesFeedParser`, imported from the :mod:`email.parser.FeedParser`
52+
module, provides an API that is conducive to incremental parsing of email messages,
5353
such as would be necessary when reading the text of an email message from a
5454
source that can block (such as a socket). The :class:`BytesFeedParser` can of
5555
course be used to parse an email message fully contained in a :term:`bytes-like
@@ -116,7 +116,7 @@ Here is the API for the :class:`BytesFeedParser`:
116116
Works like :class:`BytesFeedParser` except that the input to the
117117
:meth:`~BytesFeedParser.feed` method must be a string. This is of limited
118118
utility, since the only way for such a message to be valid is for it to
119-
contain only ASCII text or, if :attr:`~email.policy.Policy.utf8` is
119+
contain only ASCII text or, if :attr:`~email.policy.EmailPolicy.utf8` is
120120
``True``, no binary attachments.
121121

122122
.. versionchanged:: 3.3 Added the *policy* keyword.
@@ -155,11 +155,11 @@ message body, instead setting the payload to the raw body.
155155

156156
Read all the data from the binary file-like object *fp*, parse the
157157
resulting bytes, and return the message object. *fp* must support
158-
both the :meth:`~io.IOBase.readline` and the :meth:`~io.IOBase.read`
158+
both the :meth:`~io.IOBase.readline` and the :meth:`~io.TextIOBase.read`
159159
methods.
160160

161161
The bytes contained in *fp* must be formatted as a block of :rfc:`5322`
162-
(or, if :attr:`~email.policy.Policy.utf8` is ``True``, :rfc:`6532`)
162+
(or, if :attr:`~email.policy.EmailPolicy.utf8` is ``True``, :rfc:`6532`)
163163
style headers and header continuation lines, optionally preceded by an
164164
envelope header. The header block is terminated either by the end of the
165165
data or by a blank line. Following the header block is the body of the

Doc/library/functools.rst

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -199,12 +199,18 @@ The :mod:`functools` module defines the following functions:
199199
and *typed*. This is for information purposes only. Mutating the values
200200
has no effect.
201201

202+
.. method:: lru_cache.cache_info()
203+
:no-typesetting:
204+
202205
To help measure the effectiveness of the cache and tune the *maxsize*
203-
parameter, the wrapped function is instrumented with a :func:`cache_info`
206+
parameter, the wrapped function is instrumented with a :func:`!cache_info`
204207
function that returns a :term:`named tuple` showing *hits*, *misses*,
205208
*maxsize* and *currsize*.
206209

207-
The decorator also provides a :func:`cache_clear` function for clearing or
210+
.. method:: lru_cache.cache_clear()
211+
:no-typesetting:
212+
213+
The decorator also provides a :func:`!cache_clear` function for clearing or
208214
invalidating the cache.
209215

210216
The original underlying function is accessible through the
@@ -284,9 +290,9 @@ The :mod:`functools` module defines the following functions:
284290
class decorator supplies the rest. This simplifies the effort involved
285291
in specifying all of the possible rich comparison operations:
286292

287-
The class must define one of :meth:`__lt__`, :meth:`__le__`,
288-
:meth:`__gt__`, or :meth:`__ge__`.
289-
In addition, the class should supply an :meth:`__eq__` method.
293+
The class must define one of :meth:`~object.__lt__`, :meth:`~object.__le__`,
294+
:meth:`~object.__gt__`, or :meth:`~object.__ge__`.
295+
In addition, the class should supply an :meth:`~object.__eq__` method.
290296

291297
For example::
292298

@@ -418,7 +424,7 @@ The :mod:`functools` module defines the following functions:
418424
like normal functions, are handled as descriptors).
419425

420426
When *func* is a descriptor (such as a normal Python function,
421-
:func:`classmethod`, :func:`staticmethod`, :func:`abstractmethod` or
427+
:func:`classmethod`, :func:`staticmethod`, :func:`~abc.abstractmethod` or
422428
another instance of :class:`partialmethod`), calls to ``__get__`` are
423429
delegated to the underlying descriptor, and an appropriate
424430
:ref:`partial object<partial-objects>` returned as the result.
@@ -499,7 +505,10 @@ The :mod:`functools` module defines the following functions:
499505
... print("Let me just say,", end=" ")
500506
... print(arg)
501507

502-
To add overloaded implementations to the function, use the :func:`register`
508+
.. method:: singledispatch.register()
509+
:no-typesetting:
510+
511+
To add overloaded implementations to the function, use the :func:`!register`
503512
attribute of the generic function, which can be used as a decorator. For
504513
functions annotated with types, the decorator will infer the type of the
505514
first argument automatically::
@@ -565,14 +574,14 @@ The :mod:`functools` module defines the following functions:
565574
runtime impact.
566575

567576
To enable registering :term:`lambdas<lambda>` and pre-existing functions,
568-
the :func:`register` attribute can also be used in a functional form::
577+
the :func:`~singledispatch.register` attribute can also be used in a functional form::
569578

570579
>>> def nothing(arg, verbose=False):
571580
... print("Nothing.")
572581
...
573582
>>> fun.register(type(None), nothing)
574583

575-
The :func:`register` attribute returns the undecorated function. This
584+
The :func:`~singledispatch.register` attribute returns the undecorated function. This
576585
enables decorator stacking, :mod:`pickling<pickle>`, and the creation
577586
of unit tests for each variant independently::
578587

@@ -650,10 +659,10 @@ The :mod:`functools` module defines the following functions:
650659
.. versionadded:: 3.4
651660

652661
.. versionchanged:: 3.7
653-
The :func:`register` attribute now supports using type annotations.
662+
The :func:`~singledispatch.register` attribute now supports using type annotations.
654663

655664
.. versionchanged:: 3.11
656-
The :func:`register` attribute now supports
665+
The :func:`~singledispatch.register` attribute now supports
657666
:class:`typing.Union` as a type annotation.
658667

659668

@@ -783,7 +792,7 @@ The :mod:`functools` module defines the following functions:
783792
'Docstring'
784793

785794
Without the use of this decorator factory, the name of the example function
786-
would have been ``'wrapper'``, and the docstring of the original :func:`example`
795+
would have been ``'wrapper'``, and the docstring of the original :func:`!example`
787796
would have been lost.
788797

789798

Doc/library/math.rst

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ noted otherwise, all return values are floats.
4242
:func:`fabs(x) <fabs>` Absolute value of *x*
4343
:func:`floor(x) <floor>` Floor of *x*, the largest integer less than or equal to *x*
4444
:func:`fma(x, y, z) <fma>` Fused multiply-add operation: ``(x * y) + z``
45+
:func:`fmax(x, y) <fmax>` Maximum of two floating-point values
46+
:func:`fmin(x, y) <fmin>` Minimum of two floating-point values
4547
:func:`fmod(x, y) <fmod>` Remainder of division ``x / y``
4648
:func:`modf(x) <modf>` Fractional and integer parts of *x*
4749
:func:`remainder(x, y) <remainder>` Remainder of *x* with respect to *y*
@@ -248,6 +250,30 @@ Floating point arithmetic
248250
.. versionadded:: 3.13
249251

250252

253+
.. function:: fmax(x, y)
254+
255+
Get the larger of two floating-point values, treating NaNs as missing data.
256+
257+
When both operands are (signed) NaNs or zeroes, return ``nan`` and ``0``
258+
respectively and the sign of the result is implementation-defined, that
259+
is, :func:`!fmax` is not required to be sensitive to the sign of such
260+
operands (see Annex F of the C11 standard, §F.10.0.3 and §F.10.9.2).
261+
262+
.. versionadded:: next
263+
264+
265+
.. function:: fmin(x, y)
266+
267+
Get the smaller of two floating-point values, treating NaNs as missing data.
268+
269+
When both operands are (signed) NaNs or zeroes, return ``nan`` and ``0``
270+
respectively and the sign of the result is implementation-defined, that
271+
is, :func:`!fmin` is not required to be sensitive to the sign of such
272+
operands (see Annex F of the C11 standard, §F.10.0.3 and §F.10.9.3).
273+
274+
.. versionadded:: next
275+
276+
251277
.. function:: fmod(x, y)
252278

253279
Return the floating-point remainder of ``x / y``,

Doc/tools/.nitignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ Doc/extending/extending.rst
1515
Doc/library/ast.rst
1616
Doc/library/asyncio-extending.rst
1717
Doc/library/email.charset.rst
18-
Doc/library/email.parser.rst
19-
Doc/library/functools.rst
2018
Doc/library/http.cookiejar.rst
2119
Doc/library/http.server.rst
2220
Doc/library/importlib.rst

Doc/whatsnew/3.15.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ math
212212
* Add :func:`math.isnormal` and :func:`math.issubnormal` functions.
213213
(Contributed by Sergey B Kirpichev in :gh:`132908`.)
214214

215-
* Add :func:`math.signbit` function.
215+
* Add :func:`math.fmax`, :func:`math.fmin` and :func:`math.signbit` functions.
216216
(Contributed by Bénédikt Tran in :gh:`135853`.)
217217

218218

Include/Python.h

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -45,19 +45,19 @@
4545
# endif
4646
#endif
4747

48-
// gh-111506: The free-threaded build is not compatible with the limited API
49-
// or the stable ABI.
50-
#if defined(Py_LIMITED_API) && defined(Py_GIL_DISABLED)
51-
# error "The limited API is not currently supported in the free-threaded build"
52-
#endif
48+
#if defined(Py_GIL_DISABLED)
49+
# if defined(Py_LIMITED_API) && !defined(_Py_OPAQUE_PYOBJECT)
50+
# error "Py_LIMITED_API is not currently supported in the free-threaded build"
51+
# endif
5352

54-
#if defined(Py_GIL_DISABLED) && defined(_MSC_VER)
55-
# include <intrin.h> // __readgsqword()
56-
#endif
53+
# if defined(_MSC_VER)
54+
# include <intrin.h> // __readgsqword()
55+
# endif
5756

58-
#if defined(Py_GIL_DISABLED) && defined(__MINGW32__)
59-
# include <intrin.h> // __readgsqword()
60-
#endif
57+
# if defined(__MINGW32__)
58+
# include <intrin.h> // __readgsqword()
59+
# endif
60+
#endif // Py_GIL_DISABLED
6161

6262
// Include Python header files
6363
#include "pyport.h"

Include/internal/mimalloc/mimalloc/types.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,7 @@ typedef struct mi_segment_s {
481481
struct mi_segment_s* next; // the list of freed segments in the cache (must be first field, see `segment.c:mi_segment_init`)
482482

483483
size_t abandoned; // abandoned pages (i.e. the original owning thread stopped) (`abandoned <= used`)
484-
size_t abandoned_visits; // count how often this segment is visited in the abandoned list (to force reclaim it it is too long)
484+
size_t abandoned_visits; // count how often this segment is visited in the abandoned list (to force reclaim if it is too long)
485485
size_t used; // count of pages in use
486486
uintptr_t cookie; // verify addresses in debug mode: `mi_ptr_cookie(segment) == segment->cookie`
487487

0 commit comments

Comments
 (0)