Skip to content

Commit 38ddac7

Browse files
authored
Merge branch 'main' into list_freelist_plus
2 parents 42c7abb + a693eaa commit 38ddac7

118 files changed

Lines changed: 9659 additions & 755 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.

.github/workflows/tail-call.yml

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
- aarch64-unknown-linux-gnu/gcc
4646
- free-threading
4747
llvm:
48-
- 19
48+
- 20
4949
include:
5050
# - target: i686-pc-windows-msvc/msvc
5151
# architecture: Win32
@@ -83,9 +83,9 @@ jobs:
8383
if: runner.os == 'Windows' && matrix.architecture != 'ARM64'
8484
shell: cmd
8585
run: |
86-
choco install llvm --allow-downgrade --no-progress --version ${{ matrix.llvm }}.1.5
86+
choco install llvm --allow-downgrade --no-progress --version ${{ matrix.llvm }}.1.0
8787
set PlatformToolset=clangcl
88-
set LLVMToolsVersion=${{ matrix.llvm }}.1.5
88+
set LLVMToolsVersion=${{ matrix.llvm }}.1.0
8989
set LLVMInstallDir=C:\Program Files\LLVM
9090
call ./PCbuild/build.bat --tail-call-interp -d -p ${{ matrix.architecture }}
9191
call ./PCbuild/rt.bat -d -p ${{ matrix.architecture }} -q --multiprocess 0 --timeout 4500 --verbose2 --verbose3
@@ -95,26 +95,28 @@ jobs:
9595
if: runner.os == 'Windows' && matrix.architecture == 'ARM64'
9696
shell: cmd
9797
run: |
98-
choco install llvm --allow-downgrade --no-progress --version ${{ matrix.llvm }}.1.5
98+
choco install llvm --allow-downgrade --no-progress --version ${{ matrix.llvm }}.1.0
9999
set PlatformToolset=clangcl
100-
set LLVMToolsVersion=${{ matrix.llvm }}.1.5
100+
set LLVMToolsVersion=${{ matrix.llvm }}.1.0
101101
set LLVMInstallDir=C:\Program Files\LLVM
102102
./PCbuild/build.bat --tail-call-interp -p ${{ matrix.architecture }}
103103
104104
# The `find` line is required as a result of https://github.com/actions/runner-images/issues/9966.
105105
# This is a bug in the macOS runner image where the pre-installed Python is installed in the same
106106
# directory as the Homebrew Python, which causes the build to fail for macos-13. This line removes
107107
# the symlink to the pre-installed Python so that the Homebrew Python is used instead.
108+
# Note: when a new LLVM is released, the homebrew installation directory changes, so the builds will fail.
109+
# We either need to upgrade LLVM or change the directory being pointed to.
108110
- name: Native macOS (release)
109111
if: runner.os == 'macOS'
110112
run: |
111113
brew update
112114
find /usr/local/bin -lname '*/Library/Frameworks/Python.framework/*' -delete
113115
brew install llvm@${{ matrix.llvm }}
114116
export SDKROOT="$(xcrun --show-sdk-path)"
115-
export PATH="/opt/homebrew/opt/llvm@${{ matrix.llvm }}/bin:$PATH"
116-
export PATH="/usr/local/opt/llvm@${{ matrix.llvm }}/bin:$PATH"
117-
CC=clang-19 ./configure --with-tail-call-interp
117+
export PATH="/usr/local/opt/llvm/bin:$PATH"
118+
export PATH="/opt/homebrew/opt/llvm/bin:$PATH"
119+
CC=clang-20 ./configure --with-tail-call-interp
118120
make all --jobs 4
119121
./python.exe -m test --multiprocess 0 --timeout 4500 --verbose2 --verbose3
120122
@@ -123,7 +125,7 @@ jobs:
123125
run: |
124126
sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" ./llvm.sh ${{ matrix.llvm }}
125127
export PATH="$(llvm-config-${{ matrix.llvm }} --bindir):$PATH"
126-
CC=clang-19 ./configure --with-tail-call-interp --with-pydebug
128+
CC=clang-20 ./configure --with-tail-call-interp --with-pydebug
127129
make all --jobs 4
128130
./python -m test --multiprocess 0 --timeout 4500 --verbose2 --verbose3
129131
@@ -132,7 +134,7 @@ jobs:
132134
run: |
133135
sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" ./llvm.sh ${{ matrix.llvm }}
134136
export PATH="$(llvm-config-${{ matrix.llvm }} --bindir):$PATH"
135-
CC=clang-19 ./configure --with-tail-call-interp --disable-gil
137+
CC=clang-20 ./configure --with-tail-call-interp --disable-gil
136138
make all --jobs 4
137139
./python -m test --multiprocess 0 --timeout 4500 --verbose2 --verbose3
138140

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ tags
3838
TAGS
3939
.vs/
4040
.vscode/
41+
.cache/
4142
gmon.out
4243
.coverage
4344
.mypy_cache/

Doc/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,7 @@ dist-html:
204204
find dist -name 'python-$(DISTVERSION)-docs-html*' -exec rm -rf {} \;
205205
$(MAKE) html
206206
cp -pPR build/html dist/python-$(DISTVERSION)-docs-html
207+
rm -rf dist/python-$(DISTVERSION)-docs-html/_images/social_previews/
207208
tar -C dist -cf dist/python-$(DISTVERSION)-docs-html.tar python-$(DISTVERSION)-docs-html
208209
bzip2 -9 -k dist/python-$(DISTVERSION)-docs-html.tar
209210
(cd dist; zip -q -r -9 python-$(DISTVERSION)-docs-html.zip python-$(DISTVERSION)-docs-html)

Doc/conf.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -624,11 +624,19 @@
624624
# Options for sphinxext-opengraph
625625
# -------------------------------
626626

627-
ogp_site_url = 'https://docs.python.org/3/'
627+
ogp_canonical_url = 'https://docs.python.org/3/'
628628
ogp_site_name = 'Python documentation'
629-
ogp_image = '_static/og-image.png'
629+
ogp_social_cards = { # Used when matplotlib is installed
630+
'image': '_static/og-image.png',
631+
'line_color': '#3776ab',
632+
}
630633
ogp_custom_meta_tags = [
631-
'<meta property="og:image:width" content="200" />',
632-
'<meta property="og:image:height" content="200" />',
633634
'<meta name="theme-color" content="#3776ab" />',
634635
]
636+
if 'create-social-cards' not in tags: # noqa: F821
637+
# Define a static preview image when not creating social cards
638+
ogp_image = '_static/og-image.png'
639+
ogp_custom_meta_tags += [
640+
'<meta property="og:image:width" content="200" />',
641+
'<meta property="og:image:height" content="200" />',
642+
]

Doc/faq/programming.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1868,15 +1868,15 @@ object identity is assured. Generally, there are three circumstances where
18681868
identity is guaranteed:
18691869

18701870
1) Assignments create new names but do not change object identity. After the
1871-
assignment ``new = old``, it is guaranteed that ``new is old``.
1871+
assignment ``new = old``, it is guaranteed that ``new is old``.
18721872

18731873
2) Putting an object in a container that stores object references does not
1874-
change object identity. After the list assignment ``s[0] = x``, it is
1875-
guaranteed that ``s[0] is x``.
1874+
change object identity. After the list assignment ``s[0] = x``, it is
1875+
guaranteed that ``s[0] is x``.
18761876

18771877
3) If an object is a singleton, it means that only one instance of that object
1878-
can exist. After the assignments ``a = None`` and ``b = None``, it is
1879-
guaranteed that ``a is b`` because ``None`` is a singleton.
1878+
can exist. After the assignments ``a = None`` and ``b = None``, it is
1879+
guaranteed that ``a is b`` because ``None`` is a singleton.
18801880

18811881
In most other circumstances, identity tests are inadvisable and equality tests
18821882
are preferred. In particular, identity tests should not be used to check

Doc/library/annotationlib.rst

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -204,12 +204,6 @@ Classes
204204
means may not have any information about their scope, so passing
205205
arguments to this method may be necessary to evaluate them successfully.
206206

207-
.. important::
208-
209-
Once a :class:`~ForwardRef` instance has been evaluated, it caches
210-
the evaluated value, and future calls to :meth:`evaluate` will return
211-
the cached value, regardless of the parameters passed in.
212-
213207
.. versionadded:: 3.14
214208

215209

Doc/library/http.server.rst

Lines changed: 72 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,49 @@ handler. Code to create and run the server looks like this::
5151
.. versionadded:: 3.7
5252

5353

54-
The :class:`HTTPServer` and :class:`ThreadingHTTPServer` must be given
55-
a *RequestHandlerClass* on instantiation, of which this module
56-
provides three different variants:
54+
.. class:: HTTPSServer(server_address, RequestHandlerClass,\
55+
bind_and_activate=True, *, certfile, keyfile=None,\
56+
password=None, alpn_protocols=None)
57+
58+
Subclass of :class:`HTTPServer` with a wrapped socket using the :mod:`ssl` module.
59+
If the :mod:`ssl` module is not available, instantiating a :class:`!HTTPSServer`
60+
object fails with a :exc:`RuntimeError`.
61+
62+
The *certfile* argument is the path to the SSL certificate chain file,
63+
and the *keyfile* is the path to file containing the private key.
64+
65+
A *password* can be specified for files protected and wrapped with PKCS#8,
66+
but beware that this could possibly expose hardcoded passwords in clear.
67+
68+
.. seealso::
69+
70+
See :meth:`ssl.SSLContext.load_cert_chain` for additional
71+
information on the accepted values for *certfile*, *keyfile*
72+
and *password*.
73+
74+
When specified, the *alpn_protocols* argument must be a sequence of strings
75+
specifying the "Application-Layer Protocol Negotiation" (ALPN) protocols
76+
supported by the server. ALPN allows the server and the client to negotiate
77+
the application protocol during the TLS handshake.
78+
79+
By default, it is set to ``["http/1.1"]``, meaning the server supports HTTP/1.1.
80+
81+
.. versionadded:: next
82+
83+
.. class:: ThreadingHTTPSServer(server_address, RequestHandlerClass,\
84+
bind_and_activate=True, *, certfile, keyfile=None,\
85+
password=None, alpn_protocols=None)
86+
87+
This class is identical to :class:`HTTPSServer` but uses threads to handle
88+
requests by inheriting from :class:`~socketserver.ThreadingMixIn`. This is
89+
analogous to :class:`ThreadingHTTPServer` only using :class:`HTTPSServer`.
90+
91+
.. versionadded:: next
92+
93+
94+
The :class:`HTTPServer`, :class:`ThreadingHTTPServer`, :class:`HTTPSServer` and
95+
:class:`ThreadingHTTPSServer` must be given a *RequestHandlerClass* on
96+
instantiation, of which this module provides three different variants:
5797

5898
.. class:: BaseHTTPRequestHandler(request, client_address, server)
5999

@@ -542,6 +582,35 @@ The following options are accepted:
542582
are not intended for use by untrusted clients and may be vulnerable
543583
to exploitation. Always use within a secure environment.
544584

585+
.. option:: --tls-cert
586+
587+
Specifies a TLS certificate chain for HTTPS connections::
588+
589+
python -m http.server --tls-cert fullchain.pem
590+
591+
.. versionadded:: next
592+
593+
.. option:: --tls-key
594+
595+
Specifies a private key file for HTTPS connections.
596+
597+
This option requires ``--tls-cert`` to be specified.
598+
599+
.. versionadded:: next
600+
601+
.. option:: --tls-password-file
602+
603+
Specifies the password file for password-protected private keys::
604+
605+
python -m http.server \
606+
--tls-cert cert.pem \
607+
--tls-key key.pem \
608+
--tls-password-file password.txt
609+
610+
This option requires `--tls-cert`` to be specified.
611+
612+
.. versionadded:: next
613+
545614

546615
.. _http.server-security:
547616

Doc/library/plistlib.rst

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,7 @@ This module defines the following functions:
7878
exceptions on ill-formed XML. Unknown elements will simply be ignored
7979
by the plist parser.
8080

81-
The parser for the binary format raises :exc:`InvalidFileException`
82-
when the file cannot be parsed.
81+
The parser raises :exc:`InvalidFileException` when the file cannot be parsed.
8382

8483
.. versionadded:: 3.4
8584

@@ -170,6 +169,15 @@ The following constants are available:
170169
.. versionadded:: 3.4
171170

172171

172+
The module defines the following exceptions:
173+
174+
.. exception:: InvalidFileException
175+
176+
Raised when a file cannot be parsed.
177+
178+
.. versionadded:: 3.4
179+
180+
173181
Examples
174182
--------
175183

0 commit comments

Comments
 (0)