125477 Commits

Author SHA1 Message Date
Nathan Goldbaum
b5129b89bb
[3.13] gh-144257: document return values of PyModule_SetDocString (GH-144258) (GH-144286)
(cherry picked from commit 3e9a5b022f01fa95b4485fcf2c0c87bfb9fff837)

Co-authored-by: sobolevn <mail@sobolevn.me>
2026-01-27 18:30:48 +00:00
Victor Stinner
3df9e31142
[3.13] gh-144100: Fix crash for POINTER(str) used in ctypes argtypes (#144108) (#144245)
gh-144100: Fix crash for POINTER(str) used in ctypes argtypes (#144108)


(cherry picked from commit 8f459255eba2b6639f1912e5c5e318a7cdafada1)

Co-authored-by: VanshAgarwal24036 <148854295+VanshAgarwal24036@users.noreply.github.com>
2026-01-27 12:59:55 +01:00
Miss Islington (bot)
d6f4fb867a
[3.13] gh-142119: Clarify that one contextvars.Token can only reset once in a lifetime (GH-143693) (GH-144267)
(cherry picked from commit 487bd2dea538e36cb620dd9e0f298d731b9ede8a)

Co-authored-by: Bartosz Sławecki <bartosz@ilikepython.com>
2026-01-27 11:39:20 +01:00
Miss Islington (bot)
33a488e929
[3.13] gh-126014: test_makefile_test_folders: Ignore basically-empty directories (GH-140466) (#144268)
gh-126014: test_makefile_test_folders: Ignore basically-empty directories (GH-140466)

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.

Simplify this all into a couple of filters that let us check for empty
lists.
(cherry picked from commit 17d447e993a0ff9b7d44786ceb2a8f9510638bfa)

Co-authored-by: Stefano Rivera <stefano@rivera.za.net>
2026-01-27 10:28:09 +00:00
Miss Islington (bot)
f9f0a78f1c
[3.13] gh-101888: Add function.__builtins__ to ref documentation (GH-144174) (#144253)
gh-101888: Add function.__builtins__ to ref documentation (GH-144174)
(cherry picked from commit 933540e33217474abee3e1b53dec28ad927b6311)

Co-authored-by: Victor Stinner <vstinner@python.org>
2026-01-26 16:22:31 +00:00
Petr Viktorin
fdac87ae39
[3.13] gh-127773: Disable attribute cache on incompatible MRO entries (GH-127924) (GH-143729) 2026-01-26 16:31:52 +01:00
Miss Islington (bot)
01c18767f0
[3.13] gh-143928: Remove outdated comparison between pickle and marshal regarding recursion (GH-144025) (#144247)
gh-143928: Remove outdated comparison between pickle and marshal regarding recursion (GH-144025)
(cherry picked from commit 923d9d2ac23b583a7fb66e2867d8dcc07fec9a40)

Co-authored-by: Yashraj <yashrajpala8@gmail.com>
2026-01-26 13:45:22 +00:00
Miss Islington (bot)
ef5bc9ec9b
[3.13] gh-144233: Fix typo in os.eventfd documentation (GH-144234) (#144237)
gh-144233: Fix typo in os.eventfd documentation (GH-144234)
(cherry picked from commit 99821474336187eaf657740c4eb618044d83b9c7)

Co-authored-by: Solomon Ritzow <11698787+ritzow@users.noreply.github.com>
2026-01-26 08:16:06 +00:00
Miss Islington (bot)
f738386838
[3.13] gh-143935: Email preserve parens when folding comments (GH-143936) (#144035)
gh-143935: Email preserve parens when folding comments (GH-143936)

Fix a bug in the folding of comments when flattening an email message
using a modern email policy. Comments consisting of a very long sequence of
non-foldable characters could trigger a forced line wrap that omitted the
required leading space on the continuation line, causing the remainder of
the comment to be interpreted as a new header field. This enabled header
injection with carefully crafted inputs.
(cherry picked from commit 17d1490aa97bd6b98a42b1a9b324ead84e7fd8a2)

Co-authored-by: Seth Michael Larson <seth@python.org>
Co-authored-by: Denis Ledoux <dle@odoo.com>
2026-01-25 17:09:53 +00:00
Miss Islington (bot)
8ad828750f
[3.13] gh-143237: Fix support of named pipes in the rotating logging handlers (GH-143259) (#143298)
gh-143237: Fix support of named pipes in the rotating logging handlers (GH-143259)

This fixes regression introduced in GH-105887.
(cherry picked from commit aa8a43d179bad5cd9fbfce63b630e2ee0bd617e4)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2026-01-25 17:09:40 +00:00
Miss Islington (bot)
0a925ab591
[3.13] gh-144125: email: verify headers are sound in BytesGenerator (#144181)
gh-144125: email: verify headers are sound in BytesGenerator
(cherry picked from commit 052e55e7d44718fe46cbba0ca995cb8fcc359413)

Co-authored-by: Seth Michael Larson <seth@python.org>
Co-authored-by: Denis Ledoux <dle@odoo.com>
Co-authored-by: Denis Ledoux <5822488+beledouxdenis@users.noreply.github.com>
Co-authored-by: Petr Viktorin <302922+encukou@users.noreply.github.com>
Co-authored-by: Bas Bloemsaat <1586868+basbloemsaat@users.noreply.github.com>
2026-01-25 17:09:26 +00:00
Miss Islington (bot)
918387e491
[3.13] gh-143919: Reject control characters in http cookies (#144090)
gh-143919: Reject control characters in http cookies
(cherry picked from commit 95746b3a13a985787ef53b977129041971ed7f70)

Co-authored-by: Seth Michael Larson <seth@python.org>
Co-authored-by: Bartosz Sławecki <bartosz@ilikepython.com>
Co-authored-by: sobolevn <mail@sobolevn.me>
2026-01-25 17:09:22 +00:00
Miss Islington (bot)
a47f1b14f6
[3.13] Programming FAQ: fix some punctuaction typos (GH-144058) (#144186)
Programming FAQ: fix some punctuaction typos (GH-144058)

(cherry picked from commit 03e651d601c7d54ffe93ef1bbd4f66fafb89eded)

Co-authored-by: Bartosz Sławecki <bartosz@ilikepython.com>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2026-01-25 17:09:04 +00:00
Seth Michael Larson
a35ca3be58
[3.13] gh-143925: Reject control characters in data: URL mediatypes (#144111)
(cherry picked from commit f25509e78e8be6ea73c811ac2b8c928c28841b9f)
2026-01-25 17:06:01 +00:00
Stan Ulbrych
8072d67a7c
[3.13] gh-142461: Move misplaced NEWS entries to an appropriate section (GH-143392) (GH-144153)
(cherry picked from commit 72bacb0cd0882bce6bd7e9e2e4e9c112d70213e7)

Co-authored-by: Aniket <148300120+Aniketsy@users.noreply.github.com>
2026-01-24 17:13:13 +02:00
Terry Jan Reedy
ed102a8c5a
[3.13] gh-135142: Initial 3.15 News3.txt entries (GH-144200) (#144202)
(cherry picked from commit 29f1e778faaa31479e4ef84e2fb37a7a53984550)
2026-01-23 22:16:21 -05:00
Miss Islington (bot)
cbfebb1bc5
[3.13] gh-144027: Fix documentation for ignorechars in base64.a85decode() (GH-144028) (GH-144193)
It does not support an ASCII string.

Also add more tests.
(cherry picked from commit 25a10b60b04ab2fa802409dc6f211cf2ca028a0a)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2026-01-23 19:19:22 +00:00
Miss Islington (bot)
62489c8533
[3.13] Doc: fix incorrect reference in isasyncgenfunction docs (GH-144099) (GH-144171)
(cherry picked from commit f3dd0cae6cea38b15b42b20d39c7142a4a0f716e)

Co-authored-by: Yongtao Huang <yongtaoh2022@gmail.com>
2026-01-23 11:35:27 +01:00
Miss Islington (bot)
e4e36a716a
[3.13] gh-142779: Initialize reserved field for proper padding (GH-142780) (#144160)
gh-142779: Initialize reserved field for proper padding (GH-142780)

The jitdump specification specifies a reserved field for padding.

Initialize it so no garbage data is embedded in the jitdump files.
(cherry picked from commit 77bf4ba732a8736910bd6b7ec5a58b8ee833c95f)

Co-authored-by: stratakis <cstratak@redhat.com>
2026-01-22 17:29:57 +00:00
Stan Ulbrych
837b88fd9f
[3.13] gh-144023: Prevent follow_symlinks from being allowed with an fd of 0 (GH-144022) (#144152)
[3.13] gh-144023: Prevent follow_symlinks from being allowed with an fd of 0 (GH-144022)

The check was (fd > 0), should be (fd >= 0).
(cherry picked from commit fa44efa0ef1972ac1e2f66996303154be11f605e)

Co-authored-by: AZero13 <gfunni234@gmail.com>
2026-01-22 15:52:49 +00:00
Miss Islington (bot)
d4d37b26cb
[3.13] gh-141004: Mark up constants for PyOS_double_to_string (GH-143867) (GH-144147)
gh-141004: Mark up constants for `PyOS_double_to_string` (GH-143867)

This ensures they show up as C macros in search and the Sphinx inventory.
(cherry picked from commit fb690c38cafb15e4ccddc52aba37f9470ce201a0)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
2026-01-22 13:30:31 +01:00
Miss Islington (bot)
ac9715bf13
[3.13] gh-77188: Add pickle tests for objects with slots (GH-144116) (GH-144120)
(cherry picked from commit cf71e34940e2314ee7ca00961d86a7172286eeea)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2026-01-22 11:26:48 +00:00
Miss Islington (bot)
015b90dc02
[3.13] gh-143959: Make _datetime optional for test_sys (GH-144003) (#144144)
gh-143959: Make _datetime optional for test_sys (GH-144003)
(cherry picked from commit c447d1bc146bcf7707a619779bdcc03651adb5e3)

Co-authored-by: Jeong, YunWon <69878+youknowone@users.noreply.github.com>
2026-01-22 11:15:00 +00:00
Miss Islington (bot)
9a3aea9fd5
[3.13] gh-141004: Mark up docs of old PyMem macros (GH-143783) (GH-143865)
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)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
2026-01-22 11:52:12 +01:00
Yongtao Huang
a6acb1628f
[3.13] gh-144085: Add {gi,cr}_suspended to inspect comments and generator/coroutine tests (GH-144086) (#144134)
(cherry picked from commit 4ef30a5871db2043712945e64f33af81938d68dc)
2026-01-22 12:20:32 +03:00
Bera
740db907a8
[3.13] gh-143866: Verify return value of pathlib.write_{bytes,text} methods in tests (GH-143870) (#144078)
(cherry picked from commit cb6a662bb0f7a9da9d4ba9dda820053f8d54a9f8)

Co-authored-by: sobolevn <mail@sobolevn.me>
2026-01-20 21:34:43 +03:00
Miss Islington (bot)
77dddece52
[3.13] gh-144050: Fix stat.filemode pure Python file type detection (GH-144059) (GH-144074)
(cherry picked from commit fe629262c0db7aa18bad8bf3ac524acd8695739b)

Co-authored-by: VanshAgarwal24036 <148854295+VanshAgarwal24036@users.noreply.github.com>
2026-01-20 12:44:46 +00:00
Miss Islington (bot)
640ef9931e
[3.13] Update struct.__doc__: _Bool available unconditionally (GH-143716) (#144071)
Update struct.__doc__: _Bool available unconditionally (GH-143716)

This amends commit a9296e7f3be4d6c22271b25c86467ff867c63bbb.
(cherry picked from commit 31c81ab0a2fb7009a76426617991a9b539ab0180)

Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
2026-01-20 12:32:45 +00:00
Miss Islington (bot)
11bf6efcaf
[3.13] gh-143999: Fix: handle suspended state on types.coroutine wrappers (GH-144000) (GH-144065)
(cherry picked from commit 76b484b9d16d6a3b1749dc89d99773b5b4a5c4a5)

Co-authored-by: Yongtao Huang <yongtaoh2022@gmail.com>
2026-01-20 12:59:24 +02:00
Miss Islington (bot)
746d2f979b
[3.13] gh-143774 - Improve IDLE Format Paragraph doc (GH-143775) (#144063)
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.

(Also fix a couple case errors in cross references.)
(cherry picked from commit fa3abf5a51d42b2d62e1bc89e9465b398a567e94)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2026-01-20 09:32:55 +00:00
🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко)
c779fa2530
[3.13] Notify Sviat of GHA changes through codeowners (GH-143945) (#144052)
(cherry picked from commit 78b1370de96bab5eee82b022a9e26e633a040e0b)

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2026-01-19 23:49:20 +02:00
Miss Islington (bot)
7bca3dd1e6
[3.13] gh-102809: No longer mention Misc/gdbinit in the code (GH-143980) (#144045)
gh-102809: No longer mention `Misc/gdbinit` in the code (GH-143980)

Fix misleading comment on `PyObject_Dump`.
(cherry picked from commit f84ea1107170988742fbd350123678a5c503c1ad)

Co-authored-by: Bartosz Sławecki <bartosz@ilikepython.com>
2026-01-19 17:59:44 +00:00
Miss Islington (bot)
4ada03f47f
[3.13] gh-106318: Add examples for str.rpartition() method (GH-143891) (#144041)
gh-106318: Add examples for str.rpartition() method (GH-143891)
(cherry picked from commit 3c9c3d33cbdef257526871cbc12e93635026f5d6)

Co-authored-by: Adorilson Bezerra <adorilson@gmail.com>
2026-01-19 14:22:24 +00:00
Miss Islington (bot)
48a8cd1d12
[3.13] gh-143754: Modernize Tkinter docs (GH-143841) (GH-144033)
Use more relevant terminology instead of "master"/"slave" widgets where possible.
(cherry picked from commit 813fc7a291c98654c27f2b5d8f9afa8e53b066a6)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2026-01-19 12:26:26 +00:00
Gregory P. Smith
22e4d55285
[3.13] gh-143916: Reject control characters in wsgiref.headers.Headers (GH-143917) (#143973)
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>
2026-01-17 18:23:57 +00:00
Sam Gross
0f21962fb7
[3.13] gh-133253: making linecache thread-safe (GH-133305) (#143911)
(cherry picked from commit 8054184f9f32c7ba561e6e23b358074824e4928d)

Co-authored-by: vfdev <vfdev.5@gmail.com>
2026-01-16 13:34:53 -05:00
Seth Michael Larson
7025d751e5
[3.13] gh-143572: Run 'python3-libraries' fuzzer in CI using CIFuzz (… (#143915)
Co-authored-by: 🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) <578543+webknjaz@users.noreply.github.com>
Co-authored-by: 🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) <wk.cvs.github@sydorenko.org.ua>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2026-01-16 19:24:34 +02:00
Miss Islington (bot)
6fdb9f1872
[3.13] gh-65784: Add support for parametrized resource wantobjects in regrtests (GH-143570) (GH-143914)
This allows to run Tkinter tests with the specified value of
tkinter.wantobjects, for example "-u wantobjects=0".
(cherry picked from commit 21ed1e2a9401a2e96ccc910fcb66f22afc96efbd)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2026-01-16 17:01:53 +00:00
Victor Stinner
201e819355
[3.13] gh-143602: Fix duplicate buffer exports in io.BytesIO.write (#143629) (#143872) (#143878)
[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.

(cherry picked from commit c461aa99e2fabbaf5859c0a8a93e08306ee8115d)


(cherry picked from commit 1241432150f6342e3d38c5a80a19c8c157a4ebe8)

Co-authored-by: zhong <60600792+superboy-zjc@users.noreply.github.com>
2026-01-16 14:23:03 +01:00
Miss Islington (bot)
d7f11ea054
[3.13] gh-143672: Add more tests for struct.pack_into() (GH-143901) (GH-143903)
Add tests for negative offset, out of bound offset, invalid type of offset,
non-writeable buffer, non-continuous buffer, invalid type of buffer.

Repeat all tests for struct.Struct.pack_into().
(cherry picked from commit 66680f1230e51b8274279964f8d2278d12285eb3)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2026-01-16 11:49:30 +00:00
sobolevn
aa5ad50597
[3.13] gh-143635: Fix crash in ga_repr_items_list (GH-143670) (#143852)
(cherry picked from commit bdba5f0db2ab29f3deedb9416f3c143d33e4ab66)
2026-01-15 15:27:31 +00:00
Serhiy Storchaka
149ecbb9a9
[3.13] gh-142829: Fix use-after-free in Context.__eq__ via re-entrant ContextVar.set (GH-142905) (GH-143871)
(cherry picked from commit a4086d7f89e5d388e4ffcdb13e4fba0255234286)

Co-authored-by: A.Ibrahim <abdulrasheedibrahim47@gmail.com>
2026-01-15 15:00:44 +00:00
Miss Islington (bot)
343b5c4421
[3.13] gh-141004: Document symbol visibility macros (PyAPI_DATA, Py_EXPORTED_SYMBOL, Py_LOCAL_SYMBOL,Py_IMPORTED_SYMBOL) (GH-143508) (GH-143787)
(cherry picked from commit a7ba3b124f707f73b94b59f13908872f1a48e24f)

Co-authored-by: Yashraj <yashrajpala8@gmail.com>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2026-01-15 13:34:37 +01:00
Serhiy Storchaka
eb6dbd7fec
[3.13] Add regression test for add() after remove() with hash collision in set (GH-143781) (GH-143859)
(cherry picked from commit 565685f6e88fd333326baff6469f53cfff28e01e)
2026-01-15 10:04:34 +00:00
Miss Islington (bot)
2516dd0d06
[3.13] gh-143834: Fix PyLong_AsNativeBytes docs for negative number padding (GH-143840) (GH-143855)
(cherry picked from commit 421bd1770a87d141f66754ae29e407589e44ce83)

Co-authored-by: Muneeb Ullah <moneebullah25@gmail.com>
2026-01-15 09:34:21 +01:00
Serhiy Storchaka
5c028df404
[3.13] gh-141805: Fix crash after concurrent addition objects with the same hash to set (GH-143815) (GH-143853)
This happens when the set contained several elements with the same hash,
and then some of them were removed.
(cherry picked from commit b8e925b4f8f6c5e28fbebc4f3965bf77610698b3)
2026-01-15 07:59:15 +00:00
Miss Islington (bot)
8c6d87693b
[3.13] gh-106287: Do not write objects after an unmarshalling error (GH-132715) (GH-143833)
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)

Co-authored-by: Duane Griffin <duaneg@dghda.com>
2026-01-14 11:48:52 +00:00
Miss Islington (bot)
5f7a49a77b
[3.13] gh-141004: Document old provisional names for vectorcall/code API (GH-143568) (GH-143829)
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)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
2026-01-14 11:01:54 +01:00
Miss Islington (bot)
7760775375
[3.13] gh-137113 docs: note readline no longer supported in REPL after 3.13 (GH-137142) (GH-143792)
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.

Update tutorial to remove the reference, and use a different key to
test things out.
(cherry picked from commit 971f387bbb598a481aa8974ddc7a358459030415)

Signed-off-by: Kuang Yu Heng <yuheng3107@gmail.com>
Co-authored-by: Kuang Yu Heng <yuheng3107@gmail.com>
2026-01-14 10:56:18 +01:00
Gregory P. Smith
480f48035b
[3.13] gh-143706: Fix sys.argv not set during multiprocessing forkserver __main__ preload (GH-143717) (#143821)
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)
2026-01-13 18:09:05 -08:00