[3.14] gh-141938: document treatment of `OSError` raised by `HTTPConnection.getresponse` (GH-142339) (#142704)
gh-141938: document treatment of `OSError` raised by `HTTPConnection.getresponse` (GH-142339)
(cherry picked from commit 11aef219f5186fcb9b8121651e5bdbd7e84c3a4e)
[3.14] Add 'Show translation source' to docs sidebar (GH-130355) (#142686)
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com> Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Co-authored-by: Maciej Olko <maciej.olko@affirm.com>
If there are many untracked tuples, the GC will run too often, resulting
in poor performance. The fix is to include untracked tuples in the
"long lived" object count. The number of frozen objects is also now
included since the free-threaded GC must scan those too.
(cherry picked from commit e38967ed60778146050cc88dd16b70bfd867fde7)
[3.14] gh-142534: Avoid TSan warnings in dictobject.c (gh-142544) (gh-142603)
There are places we use "relaxed" loads where C11 requires "consume" or
stronger. Unfortunately, compilers don't really implement "consume" so
fake it for our use in a way that avoids upsetting TSan.
(cherry picked from commit 0a62f8277e9a0dd9f34b0b070adb83994e81b2a8)
PyUnstable_Object_IsUniqueReferencedTemporary wasn't handling tagged
ints on the evaluation stack properly.
(cherry picked from commit a26c831bc486b6e607cee6a5923bad52b97c2341)
[3.14] gh-142556: fix crash when a task gets re-registered during finalization in `asyncio` (GH-142565) (#142566)
gh-142556: fix crash when a task gets re-registered during finalization in `asyncio` (GH-142565)
(cherry picked from commit 42d2bedb875f42f0580ee2cfb4bd80a5a229bbd4)
[3.14] gh-142489: Increase ssl_handshake_timeout in asyncio tests (GH-142523) (#142545)
gh-142489: Increase ssl_handshake_timeout in asyncio tests (GH-142523)
Replace SHORT_TIMEOUT with LONG_TIMEOUT for very slow CIs.
And add the HANDSHAKE_TIMEOUT constant.
(cherry picked from commit dc3ece2bc06d56c21ef81f86424b4598880ba1c8)
Co-authored-by: Victor Stinner <vstinner@python.org>
[3.14] gh-139927: Fix test_embed on OpenIndiana (GH-142514) (#142520)
gh-139927: Fix test_embed on OpenIndiana (GH-142514)
Avoid swprintf() function in Programs/_testembed.c since it doesn't
work as expected on OpenIndiana.
(cherry picked from commit c76cfe8d89c5f44b6a012d24c0e14b45eab16b90)
Co-authored-by: Victor Stinner <vstinner@python.org>
[3.14] gh-142433: Move deref to below the error when checking for laststring (GH-142402) (#142524)
gh-142433: Move deref to below the error when checking for laststring (GH-142402)
Move deref of laststring to below the error checking so the deref
is applied after the object in strings is replaced.
(cherry picked from commit 785268fdceb0d0fe217aed1d6e43e0231c0e50c3)
[3.14] gh-140189: Use macos-14 runner for iOS CI tests (GH-142444) (#142494)
Switch to the macos-14 runner for iOS CI, working around some instability
in the macos-15 runner.
(cherry picked from commit 91884838bc3c47e02ab6099e6f9b12d80a0abae2)
Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
[3.14] gh-142454: Make the JIT digest more deterministic by sorting the files in Tools/jit (GH-142455) (#142485)
gh-142454: Make the JIT digest more deterministic by sorting the files in Tools/jit (GH-142455)
(cherry picked from commit bcf90de8ba2ea087540a5f632656ef880ee46b5c)
Co-authored-by: Miro Hrončok <miro@hroncok.cz> Co-authored-by: Ken Jin <kenjin4096@gmail.com>
[3.14] gh-112527: Fix help text for required options in argparse (GH-112528) (GH-142475)
For optional arguments with required=True, the ArgumentDefaultsHelpFormatter
would always add a " (default: None)" to the end of the help text.
Since that's a bit misleading, it is removed with this commit.
(cherry picked from commit 1adb17b1a26e1547d14ca15f915e605cfdda3edd)
On m68k, an fmove instruction accessing %fpcr may only move from
or to a data register or a memory operand. The constraint "g" also
permits the use of address registers, which is invalid. The correct
constraint is "dm". Beginning with GCC 15, the register allocator
picks an address register in the code which causes SIGILL during
runtime.
(cherry picked from commit 02c085d48b59c00fb7f4454fb13933e1c2c0b01a)
Co-authored-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de> Co-authored-by: Michael Karcher <github@mkarcher.dialup.fu-berlin.de>
Co-authored-by: Ivo Bellin Salarin <nilleb@users.noreply.github.com> Co-authored-by: Martin Panter <vadmium@users.noreply.github.com> Co-authored-by: Ivo Bellin Salarin <ivo@nilleb.com>
[3.14] gh-142346: Fix usage formatting for mutually exclusive groups in argparse (GH-142381) (GH-142385)
Support groups preceded by positional arguments or followed or intermixed
with other optional arguments. Support empty groups.
(cherry picked from commit 1db9f56bff5bbb0292b131ea8a928612acb7ec16)
[3.14] gh-142006: Fix HeaderWriteError in email.policy.default caused by extra newline (GH-142008) (#142361)
gh-142006: Fix HeaderWriteError in email.policy.default caused by extra newline (GH-142008)
RDM: This fixes a subtle folding error that showed up when a token exactly filled a line and was followed by whitespace and a token with no folding whitespace that was longer than a line. In this particular circumstance the whitespace after the first token got pushed on to the next line, and then stolen to go in front of the next unfoldable token...leaving a completely empty line in the line buffer. That line got turned in to a newline, which is RFC illegal, and the newish security check caught it. The fix is to just delete that empty line from the buffer.
(cherry picked from commit 07eff899d8a8ee4c4b1be7cb223fe25687f6216c)
[3.14] Introduce `build-python` and `build-host` subcommands for `Tools/wasm/wasi` (GH-142266) (#142322)
Introduce `build-python` and `build-host` subcommands for `Tools/wasm/wasi` (GH-142266)
It should make it easier when you need to rebuild just the e.g. host Python, but it requires ./configure to run.
(cherry picked from commit 58e1c7a16f0926b1047c336eeed2849d5fff7c70)
Co-authored-by: Brett Cannon <brett@python.org> Co-authored-by: Emma Smith <emma@emmatyping.dev>
[3.14] gh-140482: Avoid changing terminal settings in test_pty (gh-142202) (gh-142239)
The previous test_spawn_doesnt_hang test had a few problems:
* It would cause ENV CHANGED failures if other tests were running
concurrently due to stty changes
* Typing while the test was running could cause it to fail
(cherry picked from commit c0c65141b37029bfb364094a6dfb4c75ebf8359e)
[3.14] gh-119452: Fix a potential virtual memory allocation denial of service in http.server (GH-142216)
The CGI server on Windows could consume the amount of memory specified
in the Content-Length header of the request even if the client does not
send such much data. Now it reads the POST request body by chunks,
therefore the memory consumption is proportional to the amount of sent
data.
[3.14] gh-135676: Reword the f-string (and t-string) section (GH-137469) (GH-142227)
Much of the information was duplicated in stdtypes.rst; this PR keeps
lexical/syntactical details in Lexical Analysis and the evaluation & runtime
behaviour in Standard types, with cross-references between the two.
Since the t-string section only listed differences from f-strings, and the
grammar for the two is equivalent, that section was moved to Standard types
almost entirely.
(cherry picked from commit aea5531583aaa8bfdf3ebca914e9c694617c3489)
Co-authored-by: Petr Viktorin <encukou@gmail.com> Co-authored-by: Blaise Pabon <blaise@gmail.com> Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com> Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
[3.14] Being more flexible in when not to explicitly set the sysroot when compiling for WASI (GH-142242) (GH-142246)
Being more flexible in when not to explicitly set the sysroot when compiling for WASI (GH-142242)
(cherry picked from commit c5252045d3a7164f1829503d122091b5e469fda3)
This fixes a regression introduced in gh-140558. The interpreter would
crash if we inserted a non `str` key into a split table that matches an
existing key.
(cherry picked from commit 547d8daf780646e2800bec598ed32085817c8606)
Stan Ulbrych [Wed, 3 Dec 2025 12:43:06 +0000 (12:43 +0000)]
[3.14] gh-135676: Simplify docs on lexing names (GH-140464) (GH-142015)
This simplifies the Lexical Analysis section on Names (but keeps it technically correct) by putting all the info about non-ASCII characters in a separate (and very technical) section.
It uses a mental model where the parser doesn't handle Unicode complexity “immediately”, but:
- parses any non-ASCII character (outside strings/comments) as part of a name, since these can't (yet) be e.g. operators
- normalizes the name
- validates the name, using the xid_start/xid_continue sets
[3.14] gh-59000: Fix pdb breakpoint resolution for class methods when module not imported (GH-141949) (#142171)
gh-59000: Fix pdb breakpoint resolution for class methods when module not imported (GH-141949)
(cherry picked from commit 5e58548ebe8f7ac8c6cb0bad775912caa4090515)
The GC for the free threaded build would get slower with each collection due
to effectively double counting objects freed by the GC.
(cherry picked from commit eb892868b31322d7cf271bc25923e14b1f67ae38)
[3.14] gh-119342: Fix a potential denial of service in plistlib (GH-119343) (GH-142143)
Reading a specially prepared small Plist file could cause OOM because file's
read(n) preallocates a bytes object for reading the specified amount of
data. Now plistlib reads large data by chunks, therefore the upper limit of
consumed memory is proportional to the size of the input file.
(cherry picked from commit 694922cf40aa3a28f898b5f5ee08b71b4922df70)
[3.14] gh-119452: Fix a potential virtual memory allocation denial of service in http.server (GH-119455)
The CGI server on Windows could consume the amount of memory specified
in the Content-Length header of the request even if the client does not
send such much data. Now it reads the POST request body by chunks,
so that the memory consumption is proportional to the amount of sent
data.