Skip to content

Commit e06ed22

Browse files
generatedunixname1734921407115435meta-codesync[bot]
authored andcommitted
Import CPython 3.14.6+ stable branch (2026-07-07)
Summary: Imported python/cpython `3.14.6+` from upstream rev [`ef862d6`](https://www.github.com/python/cpython/commit/ef862d613a609ea1b1acd452583dd27a68e5afaa) (committed 2026-07-07 00:24:20+00:00). # Commit Info - Base: (`3.14.6+`) - [`07efb08`](https://www.github.com/python/cpython/commit/07efb08123ba9367a7107325adb9d5626dca1ca9) (commit date: 2026-07-04 18:08:05+00:00) - Imported: (`3.14.6+`) - [`ef862d6`](https://www.github.com/python/cpython/commit/ef862d613a609ea1b1acd452583dd27a68e5afaa) (commit date: 2026-07-07 00:24:20+00:00) # Noteworthy file changes - Low-signal files (9 added, 3 removed) (NEWS.d, docs, .github) Complete list of added/removed files: https://www.internalfb.com/intern/everpaste/?color=0&handle=GHSlCycuBKQ2LC4DAMx6zrnBqyRMbr0LAAAz Reviewed By: itamaro Differential Revision: D110879153 fbshipit-source-id: 7c3b33310bb2032fb7c354a5b7fe2c2cec7fe641
1 parent 71bb1b4 commit e06ed22

48 files changed

Lines changed: 730 additions & 159 deletions

Some content is hidden

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

.github/workflows/build.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -240,16 +240,16 @@ jobs:
240240
strategy:
241241
fail-fast: false
242242
matrix:
243-
# macos-26 is Apple Silicon, macos-15-intel is Intel.
244-
# macos-15-intel only runs tests against the GIL-enabled CPython.
243+
# macos-26 is Apple Silicon, macos-26-intel is Intel.
244+
# macos-26-intel only runs tests against the GIL-enabled CPython.
245245
os:
246246
- macos-26
247-
- macos-15-intel
247+
- macos-26-intel
248248
free-threading:
249249
- false
250250
- true
251251
exclude:
252-
- os: macos-15-intel
252+
- os: macos-26-intel
253253
free-threading: true
254254
uses: ./.github/workflows/reusable-macos.yml
255255
with:

.github/workflows/reusable-macos.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,15 +56,15 @@ jobs:
5656
--prefix=/opt/python-dev \
5757
--with-openssl="$(brew --prefix openssl@3.0)"
5858
- name: Build CPython
59-
if : ${{ inputs.free-threading || inputs.os != 'macos-15-intel' }}
59+
if : ${{ inputs.free-threading || inputs.os != 'macos-26-intel' }}
6060
run: gmake -j8
6161
- name: Build CPython for compiler warning check
62-
if : ${{ !inputs.free-threading && inputs.os == 'macos-15-intel' }}
62+
if : ${{ !inputs.free-threading && inputs.os == 'macos-26-intel' }}
6363
run: set -o pipefail; gmake -j8 --output-sync 2>&1 | tee compiler_output_macos.txt
6464
- name: Display build info
6565
run: make pythoninfo
6666
- name: Check compiler warnings
67-
if : ${{ !inputs.free-threading && inputs.os == 'macos-15-intel' }}
67+
if : ${{ !inputs.free-threading && inputs.os == 'macos-26-intel' }}
6868
run: >-
6969
python3 Tools/build/check_warnings.py
7070
--compiler-output-file-path=compiler_output_macos.txt

.readthedocs.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,21 @@ build:
1111
os: ubuntu-24.04
1212
tools:
1313
python: "3"
14+
apt_packages:
15+
- jq
1416

1517
jobs:
16-
post_checkout:
18+
post_system_dependencies:
1719
# https://docs.readthedocs.com/platform/stable/guides/build/skip-build.html#skip-builds-based-on-conditions
1820
#
19-
# Cancel building pull requests when there aren't changes in the Doc
21+
# Cancel building pull requests when there are no changes in the Doc
2022
# directory or RTD configuration, or if we can't cleanly merge the base
2123
# branch.
2224
- |
2325
set -eEux;
2426
if [ "$READTHEDOCS_VERSION_TYPE" = "external" ];
2527
then
26-
base_branch=3.14;
28+
base_branch=$(wget -qO- "https://api.github.com/repos/python/cpython/pulls/$READTHEDOCS_VERSION" | jq -er ".base.ref");
2729
git fetch --depth=50 origin $base_branch:origin-$base_branch;
2830
for attempt in $(seq 10);
2931
do

Doc/c-api/lifecycle.dot.pdf

-18.9 KB
Binary file not shown.

Doc/c-api/lifecycle.rst

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ object's life. An arrow from *A* to *B* indicates that event *B* can occur
1919
after event *A* has occurred, with the arrow's label indicating the condition
2020
that must be true for *B* to occur after *A*.
2121

22-
.. only:: html and not epub
22+
.. only:: builder_html
2323

2424
.. raw:: html
2525

@@ -50,20 +50,13 @@ that must be true for *B* to occur after *A*.
5050
})();
5151
</script>
5252
53-
.. only:: epub or not (html or latex)
53+
.. only:: not builder_html
5454
5555
.. image:: lifecycle.dot.svg
5656
:align: center
5757
:class: invert-in-dark-mode
5858
:alt: Diagram showing events in an object's life. Explained in detail below.
5959
60-
.. only:: latex
61-
62-
.. image:: lifecycle.dot.pdf
63-
:align: center
64-
:class: invert-in-dark-mode
65-
:alt: Diagram showing events in an object's life. Explained in detail below.
66-
6760
.. container::
6861
:name: life-events-graph-description
6962

Doc/library/glob.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ not by actually invoking a subshell.
2929
The pathnames are returned in no particular order. If you need a specific
3030
order, sort the results.
3131

32-
Files beginning with a dot (``.``) can only be matched by
32+
By default, files beginning with a dot (``.``) can only be matched by
3333
patterns that also start with a dot,
3434
unlike :func:`fnmatch.fnmatch` or :func:`pathlib.Path.glob`.
3535
For tilde and shell variable expansion, use :func:`os.path.expanduser` and
@@ -70,7 +70,8 @@ The :mod:`!glob` module defines the following functions:
7070
pattern is followed by an :data:`os.sep` or :data:`os.altsep` then files will not
7171
match.
7272

73-
If *include_hidden* is true, "``**``" pattern will match hidden directories.
73+
If *include_hidden* is true, wildcards can match path segments that
74+
begin with a dot (``.``).
7475

7576
.. audit-event:: glob.glob pathname,recursive glob.glob
7677
.. audit-event:: glob.glob/2 pathname,recursive,root_dir,dir_fd glob.glob
@@ -131,7 +132,7 @@ The :mod:`!glob` module defines the following functions:
131132
Escape all special characters (``'?'``, ``'*'`` and ``'['``).
132133
This is useful if you want to match an arbitrary literal string that may
133134
have special characters in it. Special characters in drive/UNC
134-
sharepoints are not escaped, e.g. on Windows
135+
sharepoints are not escaped, for example on Windows
135136
``escape('//?/c:/Quo vadis?.txt')`` returns ``'//?/c:/Quo vadis[?].txt'``.
136137

137138
.. versionadded:: 3.4

Doc/library/http.server.rst

Lines changed: 61 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,17 @@ handler. Code to create and run the server looks like this::
3939
This class builds on the :class:`~socketserver.TCPServer` class by storing
4040
the server address as instance variables named :attr:`server_name` and
4141
:attr:`server_port`. The server is accessible by the handler, typically
42-
through the handler's :attr:`server` instance variable.
42+
through the handler's :attr:`~socketserver.BaseRequestHandler.server`
43+
instance variable.
44+
45+
.. attribute:: server_name
46+
47+
The HTTP server's fully qualified domain name.
48+
49+
.. attribute:: server_port
50+
51+
The HTTP server's port number obtained from *server_address*.
52+
4353

4454
.. class:: ThreadingHTTPServer(server_address, RequestHandlerClass)
4555

@@ -60,7 +70,7 @@ handler. Code to create and run the server looks like this::
6070
object fails with a :exc:`RuntimeError`.
6171

6272
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.
73+
and the *keyfile* is the path to the file containing the private key.
6474

6575
A *password* can be specified for files protected and wrapped with PKCS#8,
6676
but beware that this could possibly expose hardcoded passwords in clear.
@@ -140,7 +150,7 @@ instantiation, of which this module provides three different variants:
140150

141151
.. attribute:: path
142152

143-
Contains the request path. If query component of the URL is present,
153+
Contains the request path. If the query component of the URL is present,
144154
then ``path`` includes the query. Using the terminology of :rfc:`3986`,
145155
``path`` here includes ``hier-part`` and the ``query``.
146156

@@ -190,7 +200,7 @@ instantiation, of which this module provides three different variants:
190200
Specifies a format string that should be used by :meth:`send_error` method
191201
for building an error response to the client. The string is filled by
192202
default with variables from :attr:`responses` based on the status code
193-
that passed to :meth:`send_error`.
203+
passed to :meth:`send_error`.
194204

195205
.. attribute:: error_content_type
196206

@@ -238,8 +248,8 @@ instantiation, of which this module provides three different variants:
238248
.. method:: handle_expect_100()
239249

240250
When an HTTP/1.1 conformant server receives an ``Expect: 100-continue``
241-
request header it responds back with a ``100 Continue`` followed by ``200
242-
OK`` headers.
251+
request header it responds with a ``100 Continue`` followed by ``200 OK``
252+
headers.
243253
This method can be overridden to raise an error if the server does not
244254
want the client to continue. For example, the server can choose to send ``417
245255
Expectation Failed`` as a response header and ``return False``.
@@ -295,8 +305,8 @@ instantiation, of which this module provides three different variants:
295305
.. method:: send_response_only(code, message=None)
296306

297307
Sends the response header only, used for the purposes when ``100
298-
Continue`` response is sent by the server to the client. The headers not
299-
buffered and sent directly the output stream.If the *message* is not
308+
Continue`` response is sent by the server to the client. The headers are
309+
not buffered and sent directly the output stream. If the *message* is not
300310
specified, the HTTP message corresponding the response *code* is sent.
301311

302312
This method does not reject *message* containing CRLF sequences.
@@ -338,7 +348,7 @@ instantiation, of which this module provides three different variants:
338348
to create custom error logging mechanisms. The *format* argument is a
339349
standard printf-style format string, where the additional arguments to
340350
:meth:`log_message` are applied as inputs to the formatting. The client
341-
ip address and current date and time are prefixed to every message logged.
351+
IP address and current date and time are prefixed to every message logged.
342352

343353
.. method:: version_string()
344354

@@ -390,6 +400,14 @@ instantiation, of which this module provides three different variants:
390400
This will be ``"SimpleHTTP/" + __version__``, where ``__version__`` is
391401
defined at the module level.
392402

403+
.. attribute:: index_pages
404+
405+
Specifies the filenames that are treated as directory index pages.
406+
407+
Defaults to ``("index.html", "index.htm")``.
408+
409+
.. versionadded:: 3.12
410+
393411
.. attribute:: extensions_map
394412

395413
A dictionary mapping suffixes into MIME types, contains custom overrides
@@ -413,8 +431,8 @@ instantiation, of which this module provides three different variants:
413431
The request is mapped to a local file by interpreting the request as a
414432
path relative to the current working directory.
415433

416-
If the request was mapped to a directory, the directory is checked for a
417-
file named ``index.html`` or ``index.htm`` (in that order). If found, the
434+
If the request was mapped to a directory, the directory is checked for
435+
an index page as specified by :attr:`index_pages`. If found, the
418436
file's contents are returned; otherwise a directory listing is generated
419437
by calling the :meth:`list_directory` method. This method uses
420438
:func:`os.listdir` to scan the directory, and returns a ``404`` error
@@ -441,9 +459,32 @@ instantiation, of which this module provides three different variants:
441459
.. versionchanged:: 3.7
442460
Support of the ``'If-Modified-Since'`` header.
443461

444-
The :class:`SimpleHTTPRequestHandler` class can be used in the following
445-
manner in order to create a very basic webserver serving files relative to
446-
the current directory::
462+
.. method:: list_directory(path)
463+
464+
Helper to list the contents of *path* when no index page is present.
465+
466+
This returns either a :term:`file-like object` (which must be closed
467+
by the caller) or ``None`` to indicate an error, in which case the
468+
caller has nothing further to do. In either case, the headers are sent.
469+
470+
.. method:: guess_type(path)
471+
472+
Guess the type of the file at the given *path*.
473+
474+
This returns a string of the form ``type/subtype``, usable for
475+
a MIME Content-type header.
476+
477+
The default implementation looks the file's extension up in
478+
:attr:`extensions_map`, falling back to
479+
:func:`mimetypes.guess_file_type` and then to
480+
``'application/octet-stream'``.
481+
482+
.. versionchanged:: 3.13
483+
Add :func:`mimetypes.guess_file_type` as a fallback.
484+
485+
486+
The :class:`SimpleHTTPRequestHandler` class can be used to create a very basic
487+
webserver serving files relative to the current directory as follows::
447488

448489
import http.server
449490
import socketserver
@@ -459,7 +500,7 @@ the current directory::
459500

460501
:class:`SimpleHTTPRequestHandler` can also be subclassed to enhance behavior,
461502
such as using different index file names by overriding the class attribute
462-
:attr:`index_pages`.
503+
:attr:`~SimpleHTTPRequestHandler.index_pages`.
463504

464505

465506
.. class:: CGIHTTPRequestHandler(request, client_address, server)
@@ -480,7 +521,9 @@ such as using different index file names by overriding the class attribute
480521
the other common server configuration is to treat special extensions as
481522
denoting CGI scripts.
482523

483-
The :func:`do_GET` and :func:`do_HEAD` functions are modified to run CGI scripts
524+
The :func:`~SimpleHTTPRequestHandler.do_GET` and
525+
:func:`~SimpleHTTPRequestHandler.do_HEAD` functions
526+
are modified to run CGI scripts
484527
and serve the output, instead of serving files, if the request leads to
485528
somewhere below the ``cgi_directories`` path.
486529

@@ -637,13 +680,13 @@ Security considerations
637680
.. index:: pair: http.server; security
638681

639682
:class:`SimpleHTTPRequestHandler` will follow symbolic links when handling
640-
requests, this makes it possible for files outside of the specified directory
683+
requests which makes it possible for files outside of the specified directory
641684
to be served.
642685

643686
Methods :meth:`BaseHTTPRequestHandler.send_header` and
644687
:meth:`BaseHTTPRequestHandler.send_response_only` assume sanitized input
645688
and do not perform input validation such as checking for the presence of CRLF
646-
sequences. Untrusted input may result in HTTP Header injection attacks.
689+
sequences. Untrusted input may result in HTTP header injection attacks.
647690

648691
Earlier versions of Python did not scrub control characters from the
649692
log messages emitted to stderr from ``python -m http.server`` or the

0 commit comments

Comments
 (0)