Commit graph

15137 commits

Author SHA1 Message Date
Miss Islington (bot)
6cee144d3a
[3.14] gh-140306: Fix memory leaks in cross-interpreter data handling (GH-140307) (GH-140338)
(cherry picked from commit f9323213c9)

Co-authored-by: Shamil <ashm.tech@proton.me>
2025-10-19 19:53:36 +00:00
Miss Islington (bot)
128f48fd2d
[3.14] gh-140272: Fix memory leak in _gdbm.gdbm.clear() (GH-140274) (GH-140285)
(cherry picked from commit f937468e7c)

Co-authored-by: Shamil <ashm.tech@proton.me>
2025-10-18 13:17:42 +03:00
Miss Islington (bot)
32e60fa220
[3.14] gh-140120: Refresh HACL* to fix an hmac memory leak (GH-140188) (#140192)
gh-140120: Refresh HACL* to fix an hmac memory leak (GH-140188)

This pulls an updated version of HACL* that fixes the memory leak reported in GH-140120, via an upstream fix.
(cherry picked from commit 3a81313019)

Co-authored-by: Jonathan Protzenko <jonathan.protzenko+github@gmail.com>
2025-10-16 20:53:12 -07:00
Miss Islington (bot)
045e34964a
[3.14] gh-140061: Use _PyObject_IsUniquelyReferenced() to check if objects are uniquely referenced (gh-140062) (gh-140157)
The previous `Py_REFCNT(x) == 1` checks can have data races in the free
threaded build. `_PyObject_IsUniquelyReferenced(x)` is a more conservative
check that is safe in the free threaded build and is identical to
`Py_REFCNT(x) == 1` in the default GIL-enabled build.
(cherry picked from commit 32c264982e)

Co-authored-by: Sergey Miryanov <sergey.miryanov@gmail.com>
2025-10-15 14:49:17 +00:00
Miss Islington (bot)
99e42ab49c
[3.14] gh-101828: Fix jisx0213 codecs removing null characters (gh-139340) (gh-140110)
gh-101828: Fix `jisx0213` codecs removing null characters (gh-139340)
(cherry picked from commit 87eadce3e0)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2025-10-14 14:36:05 +00:00
Sergey B Kirpichev
1c55b9163b
[3.14] gh-102431: Clarify constraints on operands of Decimal logical operations (GH-102836) (#140105)
* [3.14] gh-102431: Clarify constraints on operands of Decimal logical operations (GH-102836)

Sync C/Python implementation of the decimal: logical_ops for contexts.
(cherry picked from commit 6ecf77dbde)

Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
2025-10-14 15:44:30 +02:00
Miss Islington (bot)
07eb67b859
[3.14] gh-127081: add critical sections to dbm objects (gh-132749) (#139996)
gh-127081: add critical sections to `dbm` objects (gh-132749)
(cherry picked from commit ffaeb3dddf)

Co-authored-by: Duane Griffin <duaneg@dghda.com>
2025-10-12 17:56:29 +05:30
Miss Islington (bot)
187588e675
[3.14] gh-139929: fix incorrect OpenSSL version-based guard in _ssl.c (GH-139945) (#139964)
gh-139929: fix incorrect OpenSSL version-based guard in `_ssl.c` (GH-139945)

fix OpenSSL version-based guards
(cherry picked from commit cdd3eee7fc)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-10-11 17:59:55 +00:00
Kumar Aditya
72f25a8d9a
[3.14] gh-139894: fix incorrect sharing of current task while forking in asyncio (GH-139897) (#139913)
* [3.14] gh-139894: fix incorrect sharing of current task while forking in `asyncio`  (GH-139897)

Fix incorrect sharing of current task with the forked child process by clearing thread state's current task and current loop in `PyOS_AfterFork_Child`.
(cherry picked from commit b881df47ff)

Co-authored-by: Kumar Aditya <kumaraditya@python.org>

* Update Lib/test/test_asyncio/test_unix_events.py
2025-10-10 22:36:02 +05:30
Kumar Aditya
926d734840
[3.14] gh-116738: make mmap module thread-safe (GH-139237) (#139825)
* [3.14] gh-116738: make `mmap` module thread-safe (GH-139237)
(cherry picked from commit 7f155f9c46)

Co-authored-by: Alper <alperyoney@fb.com>
2025-10-09 20:19:03 +05:30
Kumar Aditya
90cd009209
[3.14] gh-139748: fix leaks in AC error paths when using unicode FS-b… (#139789)
* [3.14] gh-139748: fix leaks in AC error paths when using unicode FS-based converters (GH-139765)
(cherry picked from commit b04a57deef)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-10-08 22:16:21 +05:30
Dino Viehland
81dc8b12f0
[3.14] gh-139525: Don't specialize functions which have a modified vectorcall (GH-139524) (#139709)
Don't specialize functions which have a modified vectorcall
2025-10-08 09:13:34 -07:00
Miss Islington (bot)
ea1ed82fed
[3.14] gh-139774: use relaxed atomics for datetime hashes (GH-139775) (#139780)
gh-139774: use relaxed atomics for datetime hashes (GH-139775)
(cherry picked from commit 49fb46f555)

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2025-10-08 21:09:09 +05:30
Miss Islington (bot)
fb223e691e
[3.14] GH-137573: Add test to check that the margin used for overflow protection is larger than the stack space used by the interpreter (GH-137724) (GH-139295)
(cherry picked from commit 16eae6d90d)

Co-authored-by: Mark Shannon <mark@hotpy.org>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
2025-10-08 14:44:16 +02:00
Miss Islington (bot)
5579708b1c
[3.14] gh-60462: Fix locale.strxfrm() on Solaris (GH-138242) (GH-138448)
It should interpret the result of wcsxfrm() as a sequence of abstract
integers, not a sequence of Unicode code points or using other encoding
scheme that does not preserve ordering.
(cherry picked from commit 482fd0c811)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-10-08 14:34:51 +02:00
Miss Islington (bot)
4e8f5e65eb
[3.14] gh-137490: Fix signal.sigwaitinfo() on NetBSD (GH-137523) (GH-138935)
Handle ECANCELED in the same way as EINTR to work around the Posix
violation in the NetBSD's implementation.
(cherry picked from commit 07d0b95b05)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-10-08 14:33:30 +02:00
Miss Islington (bot)
0188e0fd38
[3.14] gh-137986: Fix and improve the csv functions docstrings (GH-137987) (GH-138107)
The csv.register_dialect() docstring no longer imply that it returns a dialect.
All functions have now signatures.
(cherry picked from commit aa1dbd4dde)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: maurycy <5383+maurycy@users.noreply.github.com>
2025-10-08 14:27:57 +02:00
Miss Islington (bot)
d424344ce9
[3.14] bpo-41839: Fix error checking in sched_get_priority_ functions (GH-22374) (GH-138201)
(cherry picked from commit bbcb75c986)

Co-authored-by: Jakub Kulík <Kulikjak@gmail.com>
2025-10-08 14:26:59 +02:00
Miss Islington (bot)
669253fde5
[3.14] gh-138204: Forbid expansion of a shared anonymous mmap on Linux (GH-138220) (GH-138386)
This is a Linux kernel bug which caused a bus error.
https://bugzilla.kernel.org/show_bug.cgi?id=8691
(cherry picked from commit 33fcb0c4a0)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-10-08 14:26:09 +02:00
Serhiy Storchaka
9ec4e3838a
[3.14] gh-138264: Fix gcc 14 compiler warnings (GH-138265) (GH-138426)
(cherry picked from commit 4a33077fdb)
2025-10-07 22:26:05 +02:00
Stan Ulbrych
537b558ce9
[3.14] gh-137920: Fix semantically relevant typo in curses.window.attron (#137940) (GH-138506)
Originally authored by: vict-Yang

(cherry picked from commit ce70a57bc0)
2025-10-07 22:21:41 +02:00
Miss Islington (bot)
fff26500e5
[3.14] gh-130567: Fix possible crash in locale.strxfrm() (GH-138940) (GH-139265)
On some macOS versions there was an off-by-one error in wcsxfrm() which
caused writing past the end of the array if its size was not calculated
by running wcsxfrm() first.

(cherry picked from commit 5854cf38a2)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Ronald Oussoren <ronaldoussoren@mac.com>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
2025-10-07 21:54:04 +02:00
Miss Islington (bot)
cde02ae782
[3.14] gh-139283: correctly handle size limit in cursor.fetchmany() (GH-139296) (GH-139441)
Passing a negative or zero size to `cursor.fetchmany()` made it fetch all rows
instead of none.

While this could be considered a security vulnerability, it was decided to treat
this issue as a regular bug as passing a non-sanitized *size* value in the first
place is not recommended.
(cherry picked from commit bc172ee830)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
2025-10-07 21:23:08 +02:00
Miss Islington (bot)
2f14d23013
[3.14] gh-139210: Fix use-after-free in xml.etree.ElementTree.iterparse() (GH-139211) (GH-139455)
(cherry picked from commit c86eb4d3ac)

Co-authored-by: Ken Jin <kenjin@python.org>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
2025-10-07 21:13:27 +02:00
Miss Islington (bot)
ffc67b3505
[3.14] gh-138004: Fix setting a thread name on OpenIndiana (GH-138017) (#138384)
gh-138004: Fix setting a thread name on OpenIndiana (GH-138017)

Encode Solaris/Illumos thread names to ASCII, since
OpenIndiana does not support non-ASCII names.

Add tests for setting non-ASCII name for the main thread.
(cherry picked from commit c19db1d2b8)

Co-authored-by: jadonduff <jadon_duff@icloud.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-10-07 20:58:35 +02:00
Miss Islington (bot)
4429554223
[3.14] gh-116738: make cProfile module thread-safe (GH-138229) (#138575)
gh-116738: make `cProfile` module thread-safe (GH-138229)
(cherry picked from commit 8554c0917e)

Co-authored-by: Alper <alperyoney@fb.com>
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2025-10-07 18:51:22 +00:00
Gregory P. Smith
e51acb3fa6
[3.14] gh-134698: Hold a lock when the thread state is detached in ssl (GH-134724) (GH-137107)
* [3.14] gh-134698: Hold a lock when the thread state is detached in `ssl` (GH-134724)

Lock when the thread state is detached.
(cherry picked from commit e047a35b23)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>

* Only lock the SSL context, not the SSL socket.

This solves a deadlock when a socket is blocked while waiting on data,
which ended up causing a major regression in 3.13.6 (see gh-137583).

---------

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
2025-10-07 18:49:22 +00:00
Miss Islington (bot)
c4be405fe9
[3.14] gh-137044: Support large limit values in getrlimit() and setrlimit() (GH-137338) (#137506)
gh-137044: Support large limit values in getrlimit() and setrlimit() (GH-137338)

* Return large limit values as positive integers instead of negative integers
  in resource.getrlimit().
* Accept large values and reject negative values (except RLIM_INFINITY)
  for limits in resource.setrlimit().
(cherry picked from commit baefaa6cba)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-10-07 20:43:12 +02:00
Miss Islington (bot)
14e8decde7
[3.14] gh-137273: Fix debug assertion failure in locale.setlocale() on Windows (GH-137300) (#137305)
gh-137273: Fix debug assertion failure in locale.setlocale() on Windows (GH-137300)

It happened when there were at least 16 characters after dot in the
locale name.
(cherry picked from commit 718e0c89ba)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-10-07 20:39:13 +02:00
Erlend E. Aasland
ebbfd8f51a
[3.14] gh-138736: Fix sqlite3.Connection.blobopen 'row' parameter type and naming (#138738) (GH-139062)
(cherry picked from commit 8eb106240f)

Co-authored-by: chiri <chirizxc@proton.me>
2025-10-07 20:38:26 +02:00
Miss Islington (bot)
4bb33ff1c1
[3.14] gh-138779: Use the dev_t converter for st_rdev (GH-138780) (#138926)
gh-138779: Use the dev_t converter for st_rdev (GH-138780)

This allows to support device numbers larger than 2**63-1.
(cherry picked from commit 43013f72f0)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-10-08 00:06:55 +05:30
Miss Islington (bot)
29cffb1c02
[3.14] fix comment reference from man 7 signal to man 7 signal-safety (GH-138554) (#138594)
fix comment reference from man 7 signal to man 7 signal-safety (GH-138554)
(cherry picked from commit 2f5ace780b)


docs: fix comment reference from man 7 signal to man 7 signal-safety

Co-authored-by: mqudah <mohghq@gmail.com>
2025-10-07 19:34:15 +01:00
Miss Islington (bot)
6d94af4b98
[3.14] gh-139327: fix some reference leaks in sqlite3 error branches (GH-139328) (GH-139471)
(cherry picked from commit d0a3eff9d6)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-10-07 20:22:20 +02:00
Kumar Aditya
23cc8f789d
[3.14] gh-132551: make io.BytesIO thread safe (GH-132616) (#138551)
* [3.14] gh-132551: make `io.BytesIO` thread safe (GH-132616)
(cherry picked from commit 5dd3a3a58c)

Co-authored-by: Tomasz Pytel <tompytel@gmail.com>
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2025-10-07 23:48:28 +05:30
Miss Islington (bot)
75de39ba1b
[3.14] gh-137185: Fix _Py_DumpStack() async signal safety (gh-137187) (gh-137206)
Call backtrace() once when installing the signal handler to ensure that
libgcc is dynamically loaded outside the signal handler.

This fixes a "signal-unsafe call inside of a signal" TSan error from
test_faulthandler.test_enable_fd.
(cherry picked from commit 11a8652e25)

Co-authored-by: Sam Gross <colesbury@gmail.com>
2025-10-07 18:11:46 +00:00
Miss Islington (bot)
d7500f6078
[3.14] gh-138008: Fix segfaults in _ctypes due to invalid argtypes (GH-138285) (GH-138742)
(cherry picked from commit 1ce05537a3)

Signed-off-by: Nguyen Viet Dung <29406816+magnified103@users.noreply.github.com>
Co-authored-by: Yongzi Li <204532581+Yzi-Li@users.noreply.github.com>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
2025-10-07 20:00:28 +02:00
Miss Islington (bot)
7d9b2671c6
[3.14] gh-123681: Check NORMALIZE_CENTURY behavior at runtime; require C99 (GH-136022) (GH-137947)
A runtime check is needed to support cross-compiling.

Remove the _Py_NORMALIZE_CENTURY macro.
Remove _pydatetime.py's _can_support_c99.
(cherry picked from commit 719e5c3f71)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-10-07 19:59:06 +02:00
Miss Islington (bot)
c1cb785ebd
[3.14] gh-126662: naming consistency for signal.ItimerError (GH-126712) (#137122)
gh-126662: naming consistency for `signal.ItimerError` (GH-126712)
(cherry picked from commit d5fa437dfb)

Co-authored-by: Stephen Morton <git@tungol.org>
2025-10-07 19:42:46 +02:00
Miss Islington (bot)
9e13cc2896
[3.14] gh-137017: Ensure Thread.is_alive() only returns False after the underlying OS thread exits (gh-137315) (gh-138916)
(cherry picked from commit aa9ceb1721)

Co-authored-by: Abdul <abdulrasheedibrahim47@gmail.com>
Co-authored-by: Sam Gross <colesbury@gmail.com>
2025-10-07 17:37:31 +00:00
Miss Islington (bot)
a69bdab541
[3.14] gh-123828: Fix data race in _interpchannels._waiting_release (GH-124107) (GH-139517)
gh-123828: Fix data race in `_interpchannels._waiting_release` (GH-124107)
(cherry picked from commit f39dea3bae)

Co-authored-by: Nadeshiko Manju <me@manjusaka.me>
2025-10-07 13:29:37 -04:00
Miss Islington (bot)
66ca0d9ae6
[3.14] gh-139400: Make sure that parent parsers outlive their subparsers in pyexpat (GH-139403) (#139606)
Co-authored-by: Sebastian Pipping <sebastian@pipping.org>
2025-10-05 16:02:11 +00:00
Miss Islington (bot)
8cb73119c6
[3.14] gh-139573: Update OpenSSL in CI (GH-139577) (#139583)
gh-139573: Update OpenSSL in CI (GH-139577)
(cherry picked from commit 98e748b3a0)

Co-authored-by: Zachary Ware <zach@python.org>
2025-10-05 07:50:26 +03:00
Miss Islington (bot)
57617732af
[3.14] gh-139312: Update bundled libexpat to 2.7.3 (GH-139319) (#139376)
gh-139312: Update bundled libexpat to 2.7.3 (GH-139319)

(cherry picked from commit 48d0d0dd97)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2025-09-27 08:10:07 +02:00
Miss Islington (bot)
97f4ac28cb
[3.14] gh-138998: Upgrade vendored expat to 2.7.2 (GH-138999) (#139024)
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2025-09-17 15:41:02 +03:00
Miss Islington (bot)
c0d490d9c4
[3.14] gh-135755: Make Py_MAX_SCRIPT_PATH_SIZE private (GH-138350) (#138356)
Co-authored-by: Victor Stinner <vstinner@python.org>
2025-09-16 15:49:35 +03:00
Bénédikt Tran
c8cc39d938
[3.14] gh-116946: fully implement GC protocol for zlib objects (GH-138290) (#138327) 2025-09-12 16:22:33 +03:00
Miss Islington (bot)
1cb1c2c03b
[3.14] gh-138659: Typo in the gc module docstring (GH-138660) (#138662)
gh-138659: Typo in the gc module docstring (GH-138660)

docs(gc): fix typo in get_threshold() docstring

Removes a duplicate "the" from the docstring for the `gc.get_threshold()` function.
(cherry picked from commit c006a623e7)

Co-authored-by: Aalaap Dey <65075436+axdeyy@users.noreply.github.com>
2025-09-08 14:41:34 +00:00
Bénédikt Tran
9cc2b25101
[3.14] gh-116946: fully implement GC protocol for _curses_panel.panel (GH-138333) (#138427) 2025-09-06 21:20:35 +03:00
Miss Islington (bot)
6c2d42f3f2
[3.14] GH-132775: Fix argument parsing for `_interpqueues.put()` (GH-137686) (#138034)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-08-27 16:53:39 +03:00
Zachary Ware
d8f4d56f83
[3.14] gh-132339: Add support for OpenSSL 3.5 (GH-137720) (#137747)
* Add OpenSSL 3.5.2 definitions to Modules/_ssl_data_35.h (moved from Modules/_ssl_data_34.h)

* Demote OpenSSL 3.1 to "old", remove it from CI

* Update all OpenSSL versions to latest patchlevel in CI config and multissltests defaults

* Add OpenSSL 3.5.2 to CI configuration and multissltests default list

* Fix a typo in the argument parser description of multissltests.py
(cherry picked from commit 7a703c8f19)
2025-08-14 08:58:18 +03:00