The code in test_makefile was attempting to ignore any
non-interesting files, but missed some corners:
1. There is never a *file* called `__pycache__`.
2. A directory containing only a `__pycache__` subdirectory should be
ignored.
3. A directory containing only hidden files should be ignored.
[3.14] gh-143513: Remove importlib.abc documentation for removed ABCs (GH-143605) (GH-144166)
gh-143513: Remove importlib.abc documentation for removed ABCs (GH-143605)
In 3.11 ResourceReader, Traversable, & TraversableResources moved from importlib.abc to importlib.resources.abc (commit e712a5b277866a71c195f38c1b5d87d9126dba3e).
[3.14] gh-141004: Mark up docs of old PyMem macros (GH-143783) (GH-143864)
gh-141004: Mark up docs of old PyMem macros (GH-143783)
These had a docs-only deprecation notice since the first version of the docs in this repo. Nowadays we call things “soft deprecated” if there's just a note in the docs.
The deprecated directive needs a version, I went with the first one that had the notice (2.0; it's not in 1.6):
- https://docs.python.org/release/2.0/api/memoryInterface.html
- https://docs.python.org/release/1.6/api/memoryInterface.html
Since PEP 445, they are now direct aliases; there are no (additional) binary compatibility concerns over the preferred names.
(cherry picked from commit a009e78b79ec340d9ff0e1a8ad20f8178fd3257f)
[3.14] gh-143993: Document ways to disable remote debugging support (GH-143994) (#144139)
gh-143993: Document ways to disable remote debugging support (GH-143994)
Although PEP 768 mentions how to disable the mechanism of
remote debugging, it is not documented in the Python docs.
This change adds a note on how to disable remote debugging support
in a Python interpreter to the remote debugging how-to.
(cherry picked from commit 0b5f8359c52f8a5ce0fe436cde499553f3b8f5d5)
Co-authored-by: Rafael Weingartner-Ortner <38643099+RafaelWO@users.noreply.github.com> Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
[3.14] gh-144085: Add `{gi,cr}_suspended` to `inspect` comments and `generator/coroutine` tests (GH-144086) (#144104)
gh-144085: Add `{gi,cr}_suspended` to `inspect` comments and `generator/coroutine` tests (GH-144086)
(cherry picked from commit 4ef30a5871db2043712945e64f33af81938d68dc)
[3.14] gh-143774 - Improve IDLE Format Paragraph doc (GH-143775) (#144062)
gh-143774 - Improve IDLE Format Paragraph doc (GH-143775)
Add a reminder to not rewrap code line to the Menu => Format => Reformat Paragraph entry.
In Editing and Nagivagion, add a new 'Format block' subsection that defines 'paragraph'
to better match what is dependably handled as more or less expected.
In particular, specify equal indents and that the resulting indent equals original indent.
Also mention that selections are expanded to complete lines and how to modify max length.
[3.14] gh-143866: Verify return value of `pathlib.write_{bytes,text}` methods in tests (GH-143870) (#144029)
gh-143866: Verify return value of `pathlib.write_{bytes,text}` methods in tests (GH-143870)
(cherry picked from commit cb6a662bb0f7a9da9d4ba9dda820053f8d54a9f8)
[3.14] gh-143916: Reject control characters in wsgiref.headers.Headers (GH-143917) (#143972)
gh-143916: Reject control characters in wsgiref.headers.Headers (GH-143917)
* Add 'test.support' fixture for C0 control characters
* gh-143916: Reject control characters in wsgiref.headers.Headers
(cherry picked from commit f7fceed79ca1bceae8dbe5ba5bc8928564da7211)
Co-authored-by: Seth Michael Larson <seth@python.org>
[3.14] gh-143674: Document F/D complex format characters in struct module (GH-143675) (#143918)
gh-143674: Document F/D complex format characters in struct module (GH-143675)
Add documentation for the F (complex from two floats) and D (complex
from two doubles) format characters in the struct module docstring.
These format characters were implemented but not documented.
(cherry picked from commit 3e932257980be8907698c378c23026e262ba066c)
Co-authored-by: Muneeb Ullah <moneebullah25@gmail.com> Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
[3.14] gh-65784: Add support for parametrized resource wantobjects in regrtests (GH-143570) (GH-143913)
This allows to run Tkinter tests with the specified value of
tkinter.wantobjects, for example "-u wantobjects=0".
(cherry picked from commit 21ed1e2a9401a2e96ccc910fcb66f22afc96efbd)
Victor Stinner [Thu, 15 Jan 2026 16:02:46 +0000 (17:02 +0100)]
[3.14] gh-143602: Fix duplicate buffer exports in io.BytesIO.write (#143629) (#143872)
gh-143602: Fix duplicate buffer exports in io.BytesIO.write (#143629)
Fix an inconsistency issue in io.BytesIO.write() where the buffer was exported
twice, which could lead to unexpected data overwrites and position drift when
the buffer changes between exports.
[3.14] gh-143054: Disallow non-top-level Cut for now (GH-143622) (GH-143790)
The behaviour of Cut in nested parentheses, Repeat, Opt, and similar
is somewhat chaotic. Apparently even the academic papers on PEG aren't
as clear as they could be.
And it doesn't really matter. Python only uses top-level cuts.
When that changes, we can clarify as much as necessary (and even
change the implementation to make sense for what we'll need).
Document that this is deliberately unspecified, and add a test to
make sure any decision is deliberate, tested and documented.
(cherry picked from commit f0a0467c176e245a8fd45d4480a0876d748d7e78)
[3.14] gh-141805: Fix crash after concurrent addition objects with the same hash to set (GH-143815) (GH-143849)
This happens when the set contained several elements with the same hash,
and then some of them were removed.
(cherry picked from commit b8e925b4f8f6c5e28fbebc4f3965bf77610698b3)
Co-authored-by: Peter Bierma <zintensitydev@gmail.com> Co-authored-by: Petr Viktorin <encukou@gmail.com> Co-authored-by: Victor Stinner <vstinner@python.org>
[3.14] gh-106287: Do not write objects after an unmarshalling error (GH-132715) (GH-143832)
Writing out an object may involve a slot lookup, which is not safe to do with
an exception raised. In debug mode an assertion failure will occur if this
happens.
(cherry picked from commit ce8f5f98c6fc95a1704360d986a4d0281eeada79)
[3.14] gh-141004: Document old provisional names for vectorcall/code API (GH-143568) (GH-143828)
For vectorcall API, the underscore-prefixed provisional names
continue to be available per PEP 590:
https://peps.python.org/pep-0590/#finalizing-the-api
Use `versionadded`, `versionchanged`, and `:no-typesetting:`
to mark this up.
For PyCode API, use `:no-typesetting:` rather than `index::` so that
these are semantically documented as C functions.
(cherry picked from commit 7e8a1b5061313e03f99bc2ffa2062702bcc76426)
[3.14] gh-137113 docs: note readline no longer supported in REPL after 3.13 (GH-137142) (GH-143791)
gh-137113 docs: note readline no longer supported in REPL after 3.13 (GH-137142)
Add a note to the readline module documentation stating that
Python 3.13 and later no longer supports readline in the default REPL,
as per gh-118840. Includes workaround using PYTHON_BASIC_REPL.
[3.14] gh-141004: Don't trigger `run-tests` when `Tools/check-c-api-docs/ignored_c_api.txt` is changed (GH-143583) (GH-143793)
gh-141004: Don't trigger `run-tests` when `Tools/check-c-api-docs/ignored_c_api.txt` is changed (GH-143583)
(cherry picked from commit 1176facbf21388ef29276ec55a95a66423f61191)
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
[3.14] gh-143706: Fix sys.argv not set during multiprocessing forkserver `__main__` preload (GH-143717) (#143763)
gh-143706: Fix sys.argv not set during multiprocessing forkserver `__main__` preload (GH-143717)
The forkserver was not passing sys.argv to its main() function, causing
sys.argv to be empty during `__main__` module import in child processes. This
fixes a non-obvious regression inadvertently introduced by the gh-126631 main
preloading fix.
(cherry picked from commit 298d5440eb83f2dfd5651bac86d1592ec358d54c)
Co-authored-by: Gregory P. Smith <68491+gpshead@users.noreply.github.com>
[3.14] gh-139707: Copy-strip change to idle.rst into idlelib (GH-143718) (#143744)
gh-139707: Copy-strip change to idle.rst into idlelib (GH-143718)
On Windows, running `python -c "from idlelib.help import copy_strip;
copy_strip()"` after idle.html is built results in
`f:\dev\3x\Doc\build\html\library\idle.html
copied to f:\dev\3x\Lib\idlelib\help.html`
This PR commits the html change to idlelib/help.html.
(cherry picked from commit ec254e2b40d70242f7b1724867a4aac4219fdc08)
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
[3.14] gh-143196: Fix crash in non-standard use of internal JSON encoder object (GH-143618) (GH-143748)
The internal encoder object returned by undocumented function
json.encoder.c_make_encoder() (aka _json.make_encoder()) crashed
when it was called with non-zero second argument.
(cherry picked from commit c559135c931789ebc752ae68814858c398cb798b)
[3.14] gh-143544: Fix possible use-after-free in the JSON decoder when JSONDecodeError disappears during raising it (GH-143561) (#143733)
gh-143544: Fix possible use-after-free in the JSON decoder when JSONDecodeError disappears during raising it (GH-143561)
(cherry picked from commit c3157480601499565fd42a8afbdb0207328ac484)
[3.14] gh-127750: Fix annotations in singledispatchmethod signature tests (GH-143571) (GH-143707)
These tests relied on a bug -- gh-84644, which is that singledispatch
doesn't verify the annotation is on the "first" parameter.
(cherry picked from commit 620a5b92693ac1b2cef1f90fd3c2dba1bb794552)
Serhiy Storchaka [Sun, 11 Jan 2026 12:37:00 +0000 (14:37 +0200)]
[3.14] gh-143638: Forbid cuncurrent use of the Pickler and Unpickler objects in C implementation (GH-143664) (GH-143686)
Previously, this could cause crash or data corruption, now concurrent calls
of methods of the same object raise RuntimeError.
(cherry picked from commit d1282efb2b847bf9274d78c5f15ea00499b2c894)
[3.14] gh-141536: Fix a crash when running test_capi *after* test_code in the same process (GH-141537) (#143522)
gh-141536: Fix a crash when running test_capi *after* test_code in the same process (GH-141537)
(cherry picked from commit b2827de18fe88152dc38c1aa76c39b69ef59cb6f)
[3.14] gh-142829: Fix use-after-free in `Context.__eq__` via re-entrant `ContextVar.set` (GH-142905) (#143627)
gh-142829: Fix use-after-free in `Context.__eq__` via re-entrant `ContextVar.set` (GH-142905)
(cherry picked from commit a4086d7f89e5d388e4ffcdb13e4fba0255234286)
[3.14] gh-143006: Fix and optimize mixed comparison of float and int (GH-143084) (GH-143623)
When comparing negative non-integer float and int with the same number
of bits in the integer part, __neg__() in the int subclass returning
not an int caused an assertion error.
Now the integer is no longer negated. Also, reduced the number of
temporary created Python objects.
(cherry picked from commit 66bca383bd3b12d21e879d991d77b37a4c638f88)
gh-143460: Skip infinite recusion tests for infinite stack size (GH-143606)
Avoid tests being killed due to OOM on Linux if a system is configured with
'ulimit -s unlimited' by skipping tests relying on infinite recursion.
While unclear if Python should support 'ulimit -s unlimited', we should at
least try to avoid failing a PGO build running tests due to an unlimited
stack size being set.
(cherry picked from commit 61e036691c8ac70facb8d3fc39c670bde56218e8)
Signed-off-by: Jan André Reuter <j.reuter@fz-juelich.de> Co-authored-by: Jan André Reuter <jan.andre.reuter@hotmail.de>