Commit graph

125980 commits

Author SHA1 Message Date
Hugo van Kemenade
ebc2a625ad
[3.13] Docs: avoid repetitions of class references in functions.rst (GH-150891) (#151407)
Co-authored-by: Maciej Olko <maciej.olko@affirm.com>
2026-06-12 18:04:54 +03:00
Miss Islington (bot)
7c3f0bd9b0
[3.13] gh-151126: Fix crash on unset memory error in ctypes.get_errno (GH-151382) (#151400)
gh-151126: Fix crash on unset memory error in `ctypes.get_errno` (GH-151382)
(cherry picked from commit 6b217ea90b)

Co-authored-by: sobolevn <mail@sobolevn.me>
2026-06-12 11:27:19 +00:00
Miss Islington (bot)
8754abc358
[3.13] gh-151065: Copy fix for memory leak from mimalloc upstream (GH-151066) (GH-151385)
Applies d7a72c4912 to our copy of mimalloc.
(cherry picked from commit 80f9467434)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
2026-06-11 21:18:14 -04:00
Miss Islington (bot)
e812fe9bc4
[3.13] gh-151337: Avoid possible memory leak in _tkinter.c on Windows. (GH-151340) (GH-151381)
(cherry picked from commit 71805db429)

Co-authored-by: Ivy Xu <fakeshadow1337@gmail.com>
2026-06-11 20:13:33 +00:00
Miss Islington (bot)
5bc20725e2
[3.13] gh-138991: Update dataclass documentation for new eq behavior in Python 3.13 (GH-139007) (#151374)
gh-138991: Update dataclass documentation for new eq behavior in Python 3.13 (GH-139007)

And add tests.
(cherry picked from commit 402668b2b1)

Co-authored-by: Aniket <148300120+Aniketsy@users.noreply.github.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2026-06-11 17:39:04 +00:00
Miss Islington (bot)
c4f3d8c343
[3.13] gh-150285: Fix too long docstrings in GenericAlias and __class_getitem__ (GH-151354) (GH-151369)
(cherry picked from commit 65047f2e2f)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2026-06-11 17:11:49 +00:00
Miss Islington (bot)
5a92c742e6
[3.13] gh-151126: Fix missing memory error in os._path_splitroot (GH-151339) (#151362)
gh-151126: Fix missing memory error in `os._path_splitroot` (GH-151339)
(cherry picked from commit 10595b1cb7)

Co-authored-by: sobolevn <mail@sobolevn.me>
2026-06-11 16:43:15 +00:00
Miss Islington (bot)
bba688665f
[3.13] gh-101100: Fix Sphinx nitpick in unittest.mock.rst (GH-151302)
(cherry picked from commit b18168cb32)

Co-authored-by: Cody Maloney <cmaloney@users.noreply.github.com>
2026-06-11 16:38:41 +01:00
Miss Islington (bot)
8b20bedaf5
[3.13] gh-150285: Suppress showing the __getstate__() comment in the help for dataclasses (GH-151328) (GH-151333)
(cherry picked from commit 0066fd73a2)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2026-06-11 18:02:38 +03:00
sobolevn
1d74300f9f
[3.13] gh-151126: Fix missing memory errors in _interpchannelsmodule.c (GH-151239) (#151338)
(cherry picked from commit 9fd1a125bc)
2026-06-11 13:31:10 +00:00
Hugo van Kemenade
06dce35b5a
[3.13] gh-130796: Undeprecate locale.getdefaultlocale() (GH-143069) (#151318)
Co-authored-by: Victor Stinner <vstinner@python.org>
2026-06-11 14:34:40 +03:00
Miss Islington (bot)
003db2ffd0
[3.13] gh-151284: Fix test_capi on UBSan (GH-151286) (#151325)
gh-151284: Fix test_capi on UBSan (GH-151286)

Comment two checks relying on undefined behavior in
test_fromwidechar() of test_capi.

Enable test_capi in GitHub Action "Reusable Sanitizer".
(cherry picked from commit d87d772873)

Co-authored-by: Victor Stinner <vstinner@python.org>
2026-06-11 11:19:54 +00:00
Serhiy Storchaka
f1c8176636
[3.13] gh-150285: Fix merging error in GH-150458 (GH-151320) 2026-06-11 14:06:27 +03:00
Miss Islington (bot)
807333df72
[3.13] gh-151112: Move an assert that may fail in cfg_builder_check (GH-151153) (#151315)
(cherry picked from commit 2d3381035d)

Co-authored-by: Stan Ulbrych <stan@python.org>
2026-06-11 09:40:49 +00:00
Miss Islington (bot)
5c17ae6c1c
[3.13] gh-151295: Fix use-after-free in bytes.join()/bytearray.join() via re-entrant __buffer__ (GH-151296) (GH-151306)
(cherry picked from commit 84a322aa15)

Co-authored-by: tonghuaroot (童话) <tonghuaroot@gmail.com>
2026-06-11 11:30:49 +03:00
Miss Islington (bot)
d5468ba70b
[3.13] gh-136880: Add warning about PYTHONPATH (GH-151098) (GH-151298)
(cherry picked from commit 84630e2cb9)
2026-06-11 07:38:47 +01:00
Victor Stinner
db9e7556c3
[3.13] gh-151253: Dump the Python path configuration on _PyCodec_InitRegistry() failure (#151250) (#151269) (#151283) (#151287)
[3.14][3.15] gh-151253: Dump the Python path configuration on _PyCodec_InitRegistry() failure (#151250) (#151269) (#151283)

[3.15] gh-151253: Dump the Python path configuration on _PyCodec_InitRegistry() failure (#151250) (#151269)

gh-151253: Dump the Python path configuration on _PyCodec_InitRegistry() failure (#151250)

If "import encodings" fails at Python startup, dump the Python path
configuration to help users debugging their configuration. The
encodings module is the first module imported during Python startup.

(cherry picked from commit 7b6e98911e)
(cherry picked from commit 10f616cf39)
(cherry picked from commit b3a7758d8a)
2026-06-10 23:24:46 +02:00
Victor Stinner
fd0839de33
[3.13][3.14] GHA: Display output when a sanitizer test fails (#151268) (#151273) (#151280)
[3.14] GHA: Display output when a sanitizer test fails (#151268) (#151273)

GHA: Display output when a sanitizer test fails (#151268)

Modify GitHub Action "Reusable Sanitizer" to display output when a
test fails: pass -W option.

(cherry picked from commit 3a8bebd86f)
(cherry picked from commit bc75e47ffa)
2026-06-10 21:25:15 +02:00
Ned Deily
8068f718bb
[3.13] Move blurb entry to correct section. (#151270) 2026-06-10 13:29:20 -04:00
Victor Stinner
87b9729522
[3.13][3.14] gh-143988: Fix re-entrant mutation crashes in socket sendmsg/recvmsg_into (#143987) (#151251) (#151256)
[3.14] gh-143988: Fix re-entrant mutation crashes in socket sendmsg/recvmsg_into (#143987) (#151251)

gh-143988: Fix re-entrant mutation crashes in socket sendmsg/recvmsg_into (#143987)

Fix crashes in socket.sendmsg() and socket.recvmsg_into() that could
occur if buffer sequences are mutated re-entrantly during argument
parsing via __buffer__ protocol callbacks.

The bug occurs because:

1. PySequence_Fast() returns the original list object when the input
   is already a list (not a copy).
2. During iteration, PyObject_GetBuffer() triggers __buffer__
   callbacks which may clear the list.
3. Subsequent iterations access invalid memory (heap OOB read).

The fix replaces PySequence_Fast() with PySequence_Tuple() which
always creates a new tuple, ensuring the sequence cannot be mutated
during iteration.

(cherry picked from commit 896f7fdc7d)



(cherry picked from commit 632daaf5e9)

Co-authored-by: tonghuaroot (童话) <tonghuaroot@gmail.com>
Co-authored-by: tonghuaroot <23011166+tonghuaroot@users.noreply.github.com>
2026-06-10 19:04:04 +02:00
Victor Stinner
a1f43ef9d9
[3.13][3.14] gh-89554: Document socket.SocketType as a class (#150683) (#151245) (#151254)
[3.14] gh-89554: Document socket.SocketType as a class (#150683) (#151245)

gh-89554: Document socket.SocketType as a class (#150683)

socket.SocketType is a class (re-exported from _socket as an alias of
_socket.socket, the base class of socket.socket), but was documented with
the ".. data::" directive, so ":class:" cross-references to it cannot
resolve against a py:class target.

Switch the entry to ".. class::", correct the misleading description
(SocketType is the base class of the socket type, not "type(socket(...))"
which is socket.socket; addresses gh-88427), move it into the Socket
Objects section, and document the socket object methods and attributes
nested under the socket class, dropping the redundant "socket." prefix.

Backport to 3.13: Replace ":platform: Windows" with
".. availability:: Windows" in ioctl() method.

(cherry picked from commit a621e8ad81)


(cherry picked from commit 4ef6a375a1)

Co-authored-by: Bernát Gábor <gaborjbernat@gmail.com>
2026-06-10 19:02:34 +02:00
Harjoth Khara
4866da0802
[3.13] gh-109940: Respect VIRTUAL_ENV_DISABLE_PROMPT in activate.bat (GH-151215) (GH-151263) 2026-06-10 17:49:45 +01:00
Thomas Wouters
3a04c62e38 Merge branch '3.13' of https://github.com/python/cpython into 3.13 2026-06-10 18:01:42 +02:00
Thomas Wouters
d3e29c1157 Post 3.13.14 2026-06-10 18:01:10 +02:00
Miss Islington (bot)
60123e619a
[3.13] Docs: Fix typos in the "Memory Management" section (GH-151243)
(cherry picked from commit 8c0e2515bb)

Co-authored-by: Manoj K M <manojkm24dev@gmail.com>
2026-06-10 13:20:03 +00:00
Miss Islington (bot)
a1f9bd2346
[3.13] gh-150988: Fix refleak in OSError when attrs are set before super().__init__() (GH-150990) (#151242)
gh-150988: Fix refleak in `OSError` when attrs are set before `super().__init__()` (GH-150990)
(cherry picked from commit f2a0f82282)

Co-authored-by: Lukas Geiger <lukas.geiger94@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2026-06-10 12:51:12 +00:00
Thomas Wouters
fd17997c38 Python 3.13.14 2026-06-10 14:24:04 +02:00
Miss Islington (bot)
52ee56a88e
[3.13] gh-80384: Fix docs for PyWeakref_NewRef() and PyWeakref_NewProxy() (GH-151146) (GH-151233)
The type of the callback argument is not checked.
(cherry picked from commit 0b6adeb20f)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2026-06-10 10:48:23 +00:00
Victor Stinner
c40e6d6ebb
[3.13][3.15] gh-143008: Fix race re-initializing TextIOWrapper (#151203) (#151227)
[3.15] gh-143008: Fix race re-initializing TextIOWrapper (#151203)

__init__() changes multiple variables and may be called more than once
from multiple threads.

(cherry picked from commit 0318867acf)

Co-authored-by: Cody Maloney <cmaloney@users.noreply.github.com>
2026-06-10 09:40:14 +00:00
Serhiy Storchaka
78ed7ff899
[3.13] gh-150285: Fix too long docstrings in the concurrent package (GH-151076) (#151178)
(cherry picked from commit 0fa06f4d7f)
2026-06-09 22:25:09 +02:00
Serhiy Storchaka
52ffdeda1d
[3.13] gh-151130: Add more tests for PyWeakref_* C API (GH-151131) (GH-151141) (#151148)
(cherry picked from commit cb96d5ea4a)


(cherry picked from commit c3cd75afdf)
2026-06-09 22:24:39 +02:00
Abduaziz π
99dc88db09
[3.13] gh-132467: Document and test that generic aliases are not classes (GH-133504) (#151117)
(cherry picked from commit 5915a1fb9d)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2026-06-09 22:24:02 +02:00
Miss Islington (bot)
fc600e4178
[3.13] gh-101100: Fix Sphinx warnings in 'Buffer Object Structures' documentation (GH-151058) (#151071)
(cherry picked from commit a1873300ee)

Co-authored-by: Christian Zinck <christian.zinck@gmail.com>
Co-authored-by: Stan Ulbrych <stan@python.org>
2026-06-09 22:21:51 +02:00
Petr Viktorin
743482a87e
[3.13] gh-149231: tomllib: Limit the number of parts in a key (GH-149233) (GH-149815) (#149848)
[3.14] gh-149231: tomllib: Limit the number of parts in a key (GH-149233) (GH-149815)

(cherry picked from commit bc7c102f34)
(cherry picked from commit 724a5e5e3b)

Co-authored-by: Stan Ulbrych <stan@python.org>
2026-06-09 22:20:07 +02:00
Miss Islington (bot)
310125eb9d
[3.13] gh-151112: Fix double free in assemble_init when out of memory (GH-151142) (#151207)
gh-151112: Fix double free in `assemble_init` when out of memory (GH-151142)
(cherry picked from commit 580499177c)

Co-authored-by: Stan Ulbrych <stan@python.org>
2026-06-09 21:13:40 +01:00
Zachary Ware
7d530aa588
[3.13] gh-151159: Bump OpenSSL version for Android (GH-151200) 2026-06-09 13:21:33 -05:00
Zachary Ware
2d8b0b83c1
[3.13] gh-151159: Update CI to use latest SSL library versions (GH-151202)
(cherry picked from commit 7053bbd7fd)
2026-06-09 18:04:32 +00:00
Ned Deily
4a3d64eef0
[3.13] gh-151159: Update macOS installer to use OpenSSL 3.0.21. (#151195) 2026-06-09 13:40:05 -04:00
Zachary Ware
09c00dbfc3
[3.13] gh-151159: Update Windows builds to use OpenSSL 3.0.21 (GH-151191) 2026-06-09 17:39:56 +00:00
Savannah Ostrowski
848b9823bc
[3.13] GH-59633: Clarify dest collisions in argparse docs (GH-150987) (#151196)
(cherry picked from commit 82cb7d4bf6)
2026-06-09 17:26:45 +00:00
Serhiy Storchaka
bbda3360a4
[3.13] gh-150285: Fix too long docstrings in the asyncio package (GH-151074) (GH-151175) (GH-151185)
(cherry picked from commit e0ad8745c8)
(cherry picked from commit ed2b04248a)
2026-06-09 17:12:18 +00:00
Miss Islington (bot)
04884519ce
[3.13] gh-151126: Add missing PyErr_NoMemory in _winapi module (GH-151154) (#151182)
gh-151126: Add missing `PyErr_NoMemory` in `_winapi` module (GH-151154)
(cherry picked from commit 8d94fa7b86)

Co-authored-by: sobolevn <mail@sobolevn.me>
2026-06-09 17:07:51 +00:00
Miss Islington (bot)
b032f3fa17
[3.13] GH-54732: Tweak wording around empty lines in argument files (GH-150980) (#151167)
GH-54732: Tweak wording around empty lines in argument files (GH-150980)
(cherry picked from commit 528550e0e7)

Co-authored-by: Savannah Ostrowski <savannah@python.org>
2026-06-09 15:44:18 +00:00
Miss Islington (bot)
558764600f
[3.13] GH-61082: Clarify nargs='*' positional default behavior (GH-150989) (#151170)
GH-61082: Clarify nargs='*' positional default behavior (GH-150989)
(cherry picked from commit bc37a227b2)

Co-authored-by: Savannah Ostrowski <savannah@python.org>
2026-06-09 15:44:07 +00:00
Stan Ulbrych
fc9b11ff49
[3.13] gh-149018: Use XML_SetHashSalt16Bytes in pyexpat/_elementtree when possible (GH-149023)
(cherry picked from commit 24b8f12544)
2026-06-09 14:45:59 +00:00
Stan Ulbrych
19bc39127e
[3.13] gh-90949: expose Expat API to tune exponential expansion protections (GH-139368)
Expose the XML Expat 2.7.2 APIs to tune protections against
"billion laughs" [1] attacks.

The exposed APIs are available on Expat parsers, that is,
parsers created by `xml.parsers.expat.ParserCreate()`, as:

- `parser.SetBillionLaughsAttackProtectionActivationThreshold(threshold)`, and
- `parser.SetBillionLaughsAttackProtectionMaximumAmplification(max_factor)`.

This completes the work in f04bea44c3,
and improves the existing related documentation.

[1]: https://en.wikipedia.org/wiki/Billion_laughs_attack
(cherry picked from commit 666112376d)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2026-06-09 15:23:22 +01:00
Miss Islington (bot)
c68571c4bf
[3.13] gh-109503: Fix document for shutil.move() on usage of os.rename() since it's inaccurate (GH-109507) (GH-150613)
Nonatomic move might be used even if the files are
on the same filesystem in some cases.
(cherry picked from commit 6ecd197c03)

Co-authored-by: Fang Li <fangli@users.noreply.github.com>
2026-06-09 16:06:55 +03:00
Miss Islington (bot)
140af0fd14
[3.13] gh-151126: Fix missing PyErr_NoMemory() in remove_unused_consts (GH-151127) (#151136)
gh-151126: Fix missing `PyErr_NoMemory()` in `remove_unused_consts` (GH-151127)
(cherry picked from commit 3186547c1e)

Co-authored-by: sobolevn <mail@sobolevn.me>
2026-06-09 10:27:34 +00:00
Ned Deily
c51354e062
[3.13] gh-124111: Update macOS installer to use Tcl/Tk 8.6.18. (#151125) 2026-06-09 01:55:30 -04:00
Miss Islington (bot)
7372a146ac
[3.13] gh-115119: Update macOS installer to use libmpdecimal 4.0.1. (GH-140077) (#151124)
(cherry picked from commit 8e0bf4fe5d)
Co-authored-by: Ned Deily <nad@python.org>
2026-06-09 05:37:44 +00:00