Commit graph

131606 commits

Author SHA1 Message Date
Miss Islington (bot)
dc5ebe3da4
[3.15] gh-123619: Fix PyUnstable_Object_EnableDeferredRefcount() (GH-151260) (#151326)
gh-123619: Fix PyUnstable_Object_EnableDeferredRefcount() (GH-151260)

Return 0 if the object is not tracked by the GC.
(cherry picked from commit 72e7eddce6)

Co-authored-by: Victor Stinner <vstinner@python.org>
2026-06-11 11:21:26 +00:00
Miss Islington (bot)
491768da4c
[3.15] gh-151177: Fix race condition in _testembed (GH-151293) (GH-151312)
gh-151177: Fix race condition in `_testembed` (GH-151293)
(cherry picked from commit f9ffca3935)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
2026-06-11 06:10:55 -04:00
Miss Islington (bot)
e3b94d8fa4
[3.15] gh-151112: Move an assert that may fail in cfg_builder_check (GH-151153) (#151313)
(cherry picked from commit 2d3381035d)

Co-authored-by: Stan Ulbrych <stan@python.org>
2026-06-11 09:46:04 +00:00
Miss Islington (bot)
a8ddc9a77a
[3.15] Drop historical :author:s from HOWTOs (GH-151091) (#151310)
(cherry picked from commit 9620f69cd4)

Co-authored-by: Stan Ulbrych <stan@python.org>
2026-06-11 08:55:01 +00:00
Miss Islington (bot)
9d0999133e
[3.15] gh-151295: Fix use-after-free in bytes.join()/bytearray.join() via re-entrant __buffer__ (GH-151296) (GH-151304)
(cherry picked from commit 84a322aa15)

Co-authored-by: tonghuaroot (童话) <tonghuaroot@gmail.com>
2026-06-11 11:30:24 +03:00
Miss Islington (bot)
f3316ca675
[3.15] gh-136880: Add warning about PYTHONPATH (GH-151098) (GH-151299)
(cherry picked from commit 84630e2cb9)
2026-06-11 07:38:03 +01:00
Miss Islington (bot)
e8d914fd49
[3.15] gh-151278: Fix test_faulthandler on UBSan (GH-151279) (#151281)
gh-151278: Fix test_faulthandler on UBSan (GH-151279)

* Py_FatalError() no longer calls _PyFaulthandler_Fini() if it
  doesn't hold the GIL.
* Skip test_faulthandler tests raising signals if run with UBSan.
* Enable test_faulthandler in GitHub Action "Reusable Sanitizer".
(cherry picked from commit e60c42dc3f)

Co-authored-by: Victor Stinner <vstinner@python.org>
2026-06-10 20:07:07 +00:00
Victor Stinner
10f616cf39
[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)
2026-06-10 22:03:27 +02:00
Miss Islington (bot)
040cee94aa
[3.15] GHA: Display output when a sanitizer test fails (GH-151268) (#151272)
GHA: Display output when a sanitizer test fails (GH-151268)

Modify GitHub Action "Reusable Sanitizer" to display output when a
test fails: pass -W option.
(cherry picked from commit 3a8bebd86f)

Co-authored-by: Victor Stinner <vstinner@python.org>
2026-06-10 17:37:52 +00:00
Miss Islington (bot)
5c83037313
[3.15] gh-109940: Respect VIRTUAL_ENV_DISABLE_PROMPT in activate.bat (GH-151215) (GH-151225)
Co-authored-by: Harjoth Khara <harjoth.khara@gmail.com>
2026-06-10 17:48:10 +01:00
Miss Islington (bot)
54ee910bcd
[3.15] gh-151126: Fix missing memory errors in _interpchannelsmodule.c (GH-151239) (#151265)
gh-151126: Fix missing memory errors in `_interpchannelsmodule.c` (GH-151239)
(cherry picked from commit 9fd1a125bc)

Co-authored-by: sobolevn <mail@sobolevn.me>
2026-06-10 16:26:38 +00:00
Miss Islington (bot)
68d2372240
[3.15] gh-141984: Reword the Generator expressions section (GH-150518) (GH-151261)
(cherry picked from commit 7bbb9607a2)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Blaise Pabon <blaise@gmail.com>
Co-authored-by: Stan Ulbrych <stan@python.org>
2026-06-10 18:04:48 +02:00
Miss Islington (bot)
9261f8b588
[3.15] gh-143988: Fix re-entrant mutation crashes in socket sendmsg/recvmsg_into (GH-143987) (#151246)
gh-143988: Fix re-entrant mutation crashes in socket sendmsg/recvmsg_into (GH-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)

Co-authored-by: tonghuaroot (童话) <tonghuaroot@gmail.com>
Co-authored-by: tonghuaroot <23011166+tonghuaroot@users.noreply.github.com>
2026-06-10 14:25:33 +00:00
Miss Islington (bot)
637746d6fc
[3.15] add asyncio guide for Free-Threaded Python (GH-150456) (#151257)
add asyncio guide for Free-Threaded Python (GH-150456)
(cherry picked from commit e2bd50d2e1)

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2026-06-10 14:11:26 +00:00
Miss Islington (bot)
7a76730125
[3.15] Add yet one assertion in test_set_text_charset_cp949 (GH-151224) (GH-151237)
Add yet one assertion in test_set_text_charset_cp949 (GH-151224)

Check bytes(m), not only str(m).
(cherry picked from commit 3ca93ab198)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2026-06-10 13:36:58 +00:00
Miss Islington (bot)
9761ef9bb8
[3.15] Docs: Fix typos in the "Memory Management" section (GH-151243) (GH-151247)
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:21:48 +00:00
Miss Islington (bot)
de5da36c66
[3.15] gh-89554: Document socket.SocketType as a class (GH-150683) (#151244)
gh-89554: Document socket.SocketType as a class (GH-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.
(cherry picked from commit a621e8ad81)

Co-authored-by: Bernát Gábor <gaborjbernat@gmail.com>
2026-06-10 13:09:28 +00:00
Miss Islington (bot)
7201b9d18f
[3.15] gh-150988: Fix refleak in OSError when attrs are set before super().__init__() (GH-150990) (#151240)
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:56:54 +00:00
Miss Islington (bot)
153607ef89
[3.15] gh-98894: Fix DTrace test_check_probes for shared builds (GH-151122) (#151235)
gh-98894: Fix DTrace test_check_probes for shared builds (GH-151122)

When building with --enable-shared, the SystemTap/DTrace notes
live in libpython. Add detection logic to be used by readelf.

Force the C locale on readelf output.
(cherry picked from commit 3a08e93739)

Co-authored-by: stratakis <cstratak@redhat.com>
2026-06-10 11:35:01 +00:00
Serhiy Storchaka
0b6adeb20f
[3.15] gh-80384: Fix docs for PyWeakref_NewRef() and PyWeakref_NewProxy() (GH-151146)
The type of the callback argument is not checked.
2026-06-10 13:41:19 +03:00
Cody Maloney
0318867acf
[3.15] gh-143008: Fix race re-initializing TextIOWrapper (#151203)
__init__() changes multiple variables and may be called more than once
from multiple threads.
2026-06-10 11:13:46 +02:00
Miss Islington (bot)
73e5d444ac
[3.15] gh-150700: Fix class-scope inline comprehensions when nested scopes reference __class__ and friends (GH-150735) (#151211)
gh-150700: Fix class-scope inline comprehensions when nested scopes reference `__class__` and friends (GH-150735)

* Fix class-scope inline comprehensions when nested scopes reference `__class__` and friends

In `inline_comprehension()`, when `__class__` / `__classdict__` /
`__conditional_annotations__` appears as `FREE` in a comprehension's
symbol table because a nested scope captured it (e.g. nested lambdas),
this name is still discarded from `comp_free` unconditionally.

This prevents `drop_class_free()` from seeing it, so the appropriate
`ste_needs_(...)` flag is never set on the enclosing class.
That leads to `codegen_make_closure()` throwing `SystemError` when it
couldn't find `__class__` / `__classdict__` /
`__conditional_annotations__` in the class's cellvars.

From now on we just discard from `comp_free` when no child scope
(e.g. a lambda) still needs the name as `FREE`. When a child scope does
need it, keep it in `comp_free` so `drop_class_free()` can set the
appropriate flag and the class creates the implicit cell.

* Fix tests

* Fix typo

* Fix formatting

* Add test checking validity of `__class__` returned

* Prefer 'used' to 'deferred'
(cherry picked from commit ce916dc506)

Co-authored-by: Bartosz Sławecki <bartosz@ilikepython.com>
2026-06-09 16:33:04 -07:00
Miss Islington (bot)
50765f43f7
[3.15] gh-151112: Fix double free in assemble_init when out of memory (GH-151142) (#151205)
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 20:16:42 +00:00
Miss Islington (bot)
e25cc9e93c
[3.15] gh-151163: Update Android, macOS installer, and Windows builds to SQLite 3.53.2 (GH-151204)
(cherry picked from commit ab8ebe9034)

Co-authored-by: Zachary Ware <zach@python.org>
2026-06-09 18:56:57 +00:00
Miss Islington (bot)
dcb049f550
[3.15] gh-151159: Update CI to use latest SSL library versions (GH-151199)
(cherry picked from commit 7053bbd7fd)

Co-authored-by: Zachary Ware <zach@python.org>
2026-06-09 17:57:09 +00:00
Miss Islington (bot)
c3d0205bbc
[3.15] gh-151159: Bump OpenSSL versions for iOS and Android (GH-151197)
(cherry picked from commit 627dd14346)

Co-authored-by: Zachary Ware <zach@python.org>
2026-06-09 17:54:25 +00:00
Miss Islington (bot)
f1ca289fbf
[3.15] gh-151159: Update Windows builds to use OpenSSL 3.5.7 (GH-151189)
(cherry picked from commit 6688b0c715)

Co-authored-by: Zachary Ware <zach@python.org>
2026-06-09 17:44:44 +00:00
Miss Islington (bot)
427790ffbd
[3.15] gh-151159: Update macOS installer to use OpenSSL 3.5.7. (GH-151171) (#151192)
(cherry picked from commit 720fb82603)

Co-authored-by: Ivy Xu <fakeshadow1337@gmail.com>
2026-06-09 17:33:23 +00:00
Miss Islington (bot)
ba8d0e37e7
[3.15] GH-59633: Clarify dest collisions in argparse docs (GH-150987) (#151188)
GH-59633: Clarify dest collisions in argparse docs (GH-150987)
(cherry picked from commit 82cb7d4bf6)

Co-authored-by: Savannah Ostrowski <savannah@python.org>
2026-06-09 17:15:41 +00:00
Miss Islington (bot)
489d6af9af
[3.15] gh-151126: Add missing PyErr_NoMemory in _winapi module (GH-151154) (#151180)
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:10:18 +00:00
Miss Islington (bot)
2aba3d99ac
[3.15] gh-150285: Fix too long docstrings in the asyncio package (GH-151074) (GH-151172)
(cherry picked from commit ed2b04248a)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2026-06-09 16:41:54 +00:00
Miss Islington (bot)
ca0cb46648
[3.15] gh-150285: Fix too long docstrings in the concurrent package (GH-151076) (GH-151173)
(cherry picked from commit 0fa06f4d7f)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2026-06-09 16:41:26 +00:00
Miss Islington (bot)
fda4f22d60
[3.15] GH-61082: Clarify nargs='*' positional default behavior (GH-150989) (#151168)
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:46:39 +00:00
Miss Islington (bot)
804be0a223
[3.15] GH-54732: Tweak wording around empty lines in argument files (GH-150980) (#151165)
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:45:23 +00:00
Miss Islington (bot)
22d32b6df0
[3.15] Docs: Only add profiling-sampling-visualization.{css,js} to files when necessary (GH-151150)
(cherry picked from commit 0a179e748b)

Co-authored-by: Stan Ulbrych <stan@python.org>
2026-06-09 13:24:28 +00:00
Miss Islington (bot)
19e4b8f559
[3.15] gh-109503: Fix document for shutil.move() on usage of os.rename() since it's inaccurate (GH-109507) (GH-150611)
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:30 +03:00
Miss Islington (bot)
3199f3ba29
[3.15] gh-151039: Fix a crash when _datetime types outlive _datetime module (GH-151044) (#151143)
gh-151039: Fix a crash when `_datetime` types outlive `_datetime` module (GH-151044)
(cherry picked from commit 9fdbade99e)

Co-authored-by: sobolevn <mail@sobolevn.me>
2026-06-09 12:14:47 +00:00
Miss Islington (bot)
2d432f21db
[3.15] gh-151130: Add more tests for PyWeakref_* C API (GH-151131) (GH-151140)
(cherry picked from commit c3cd75afdf)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2026-06-09 11:37:56 +00:00
Miss Islington (bot)
8a2bf2a072
[3.15] gh-151126: Fix missing PyErr_NoMemory() in remove_unused_consts (GH-151127) (#151134)
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:33:02 +00:00
Pablo Galindo Salgado
83e26a43a7
[3.15] gh-149321: Remove lazy_imports=none startup mode (GH-149389) (#150129) 2026-06-08 22:55:57 +00:00
Miss Islington (bot)
fd252e80f5
[3.15] gh-148932: Fix profiling.sampling on Windows virtual environments (GH-150541) (#151097)
gh-148932: Fix `profiling.sampling` on Windows virtual environments (GH-150541)
(cherry picked from commit 5c13217314)

Co-authored-by: Eduardo Villalpando Mello <eduardovil@microsoft.com>
2026-06-08 23:04:06 +01:00
Miss Islington (bot)
eeba221905
[3.15] gh-150633: Minor improvement of a newly added test (GH-151103) (#151106)
gh-150633: Minor improvement of a newly added test (GH-151103)

Minor improvement of a newly added test.
(cherry picked from commit fccf67a354)

Co-authored-by: Barry Warsaw <barry@python.org>
2026-06-08 13:04:02 -07:00
Miss Islington (bot)
fd4f9fa186
[3.15] gh-151070: Fix class referencing typo in collections.abc docs (GH-151088) (GH-151110)
(cherry picked from commit 29a920e80e)

Co-authored-by: Arshal Aromal <arshalaromal19@gmail.com>
2026-06-08 19:47:05 +00:00
Miss Islington (bot)
5751633fac
[3.15] gh-150633: Properly handle null characters in the name when importing frozen modules (GH-150634) (GH-151100)
(cherry picked from commit 54de5475cd)

Co-authored-by: Thomas Kowalski <thom.kowa@gmail.com>
2026-06-08 18:58:11 +00:00
Miss Islington (bot)
e795bd4be7
[3.15] gh-119949: Refactor test_exc() helper in test_format.py (GH-135452) (GH-150329)
Use assertRaisesRegex() context and fix
https://github.com/python/cpython/pull/119781#pullrequestreview-2088240959

(cherry picked from commit 0851700a9d)

Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
2026-06-08 18:01:52 +00:00
Miss Islington (bot)
99979753b3
[3.15] gh-149816: Fix SNI callback callable race (GH-150018) (GH-150099)
(cherry picked from commit 8b31d08e62)

Co-authored-by: Kirill Ignatev <kiri11@users.noreply.github.com>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
2026-06-08 21:01:31 +03:00
Miss Islington (bot)
199751ea6a
[3.15] gh-151019: Fix test_os on 32-bit FreeBSD (GH-151087) (#151093)
gh-151019: Fix test_os on 32-bit FreeBSD (GH-151087)

Remove references to server.handler_instance. This attribute has been
removed in 2022 by commit 3ae975f1ac.
(cherry picked from commit a9002349cb)

Co-authored-by: Victor Stinner <vstinner@python.org>
2026-06-08 17:25:50 +00:00
Miss Islington (bot)
86e291e662
[3.15] gh-106318: Add examples to the str.isdigit() method docs (GH-144721)
(cherry picked from commit f051c68923)

Co-authored-by: Adorilson Bezerra <adorilson@gmail.com>
Co-authored-by: Stan Ulbrych <stan@python.org>
2026-06-08 12:59:46 +00:00
Miss Islington (bot)
39f232219e
[3.15] gh-141623: Clarify operator function descriptions (GH-141846)
(cherry picked from commit bd5fa31c5f)

Co-authored-by: Doron Behar <doron.behar@gmail.com>
2026-06-08 12:21:22 +00:00
Miss Islington (bot)
0f964f4679
[3.15] Mention frozendict in object.__hash__() documentation (GH-148867) (#151077)
(cherry picked from commit e3762114e5)

Co-authored-by: Jonathan Dung <jonathandung@yahoo.com>
2026-06-08 11:47:55 +00:00