summaryrefslogtreecommitdiffstats
path: root/Modules
Commit message (Collapse)AuthorAgeFilesLines
* [3.13] gh-139283: correctly handle `size` limit in `cursor.fetchmany()` ↵Bénédikt Tran2025-10-073-18/+101
| | | | | | | | | | | (GH-139296) (#139444) 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 bc172ee8307431caf4c89612e9e454081635191f)
* [3.13] gh-139327: fix some reference leaks in `sqlite3` error branches ↵Miss Islington (bot)2025-10-072-32/+42
| | | | | | | (GH-139328) (#139472) (cherry picked from commit d0a3eff9d6e72e209da0236fb1ea1f8c18938eaa) Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
* [3.13] gh-139400: Make sure that parent parsers outlive their subparsers in ↵Sebastian Pipping2025-10-061-0/+25
| | | | | | | | | | | `pyexpat` (GH-139403) (GH-139608) Within libexpat, a parser created via `XML_ExternalEntityParserCreate` is relying on its parent parser throughout its entire lifetime. Prior to this fix, is was possible for the parent parser to be garbage-collected too early. (cherry picked from commit 6edb2ddb5f3695cf4938979d645f31d7fba43ec8)
* [3.13] gh-139210: Fix use-after-free in xml.etree.ElementTree.iterparse() ↵Miss Islington (bot)2025-09-301-1/+1
| | | | | | | (GH-139211) (GH-139456) (cherry picked from commit c86eb4d3ac5984efc1ea920ba643e3c4f02fdee8) Co-authored-by: Ken Jin <kenjin@python.org>
* [3.13] gh-139312: Update bundled libexpat to 2.7.3 (GH-139319) (#139377)Miss Islington (bot)2025-09-275-23/+45
| | | | | | | | | gh-139312: Update bundled libexpat to 2.7.3 (GH-139319) + Blurb + Update sbom.spdx.json (cherry picked from commit 48d0d0dd9733eae4935f2ebd31bef786d8074fc8) Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
* [3.13] gh-130567: Fix possible crash in locale.strxfrm() (GH-138940) (GH-139266)Miss Islington (bot)2025-09-241-1/+3
| | | | | | | | | 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 5854cf38a25ab8b0c6ab0296098166014f77caa3) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com> Co-authored-by: Ronald Oussoren <ronaldoussoren@mac.com>
* [3.13] gh-138008: Fix segfaults in _ctypes due to invalid argtypes ↵Petr Viktorin2025-09-181-15/+25
| | | | | | | | | | | (GH-138285) (#138746) (cherry picked from commit 1ce05537a3ebaf1e5c54505b2272d61bb6cf5de0) Signed-off-by: Nguyen Viet Dung <29406816+magnified103@users.noreply.github.com> Signed-off-by: Nguyen Viet Dung <dung@ekluster.com> Co-authored-by: Dung Nguyen <dung@ekluster.com> Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com> Co-authored-by: Yongzi Li <204532581+Yzi-Li@users.noreply.github.com>
* [3.13] gh-138998: Upgrade vendored expat to 2.7.2 (GH-138999) (#139025)Miss Islington (bot)2025-09-188-374/+749
| | | | | | (cherry picked from commit 64c876dd6812ade19cb7a0c619111d30f0b2b860) Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com> Co-authored-by: Gregory P. Smith <greg@krypto.org>
* [3.13] gh-138736: Fix sqlite3.Connection.blobopen 'row' parameter type and ↵Erlend E. Aasland2025-09-172-7/+7
| | | | | | | | | naming (#138738) (#139063) The 'row' parameter represents a ROWID. Clarify this in docs and docstrings. (cherry picked from commit 8eb106240f5d70baeabd4ad137de6213dd8cfb30) Co-authored-by: chiri <chirizxc@proton.me>
* [3.13] gh-137490: Fix signal.sigwaitinfo() on NetBSD (GH-137523) (GH-138936)Miss Islington (bot)2025-09-151-1/+7
| | | | | | | Handle ECANCELED in the same way as EINTR to work around the Posix violation in the NetBSD's implementation. (cherry picked from commit 07d0b95b05dfaf5832f44c2fbc956761f9e29571) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.13] gh-138779: Use the dev_t converter for st_rdev (GH-138780) (GH-138927)Miss Islington (bot)2025-09-151-1/+1
| | | | | | This allows to support device numbers larger than 2**63-1. (cherry picked from commit 43013f72f0aadc5ee428aa5bdf6d949b4e79779a) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.13] gh-137017: Ensure `Thread.is_alive()` only returns False after the ↵Miss Islington (bot)2025-09-151-3/+6
| | | | | | | | underlying OS thread exits (gh-137315) (gh-138917) (cherry picked from commit aa9ceb17215af21ed6618d6f7ccb5bf57ca57101) Co-authored-by: Abdul <abdulrasheedibrahim47@gmail.com> Co-authored-by: Sam Gross <colesbury@gmail.com>
* [3.13] gh-138659: Typo in the gc module docstring (GH-138660) (#138663)Miss Islington (bot)2025-09-081-1/+1
| | | | | | | | | | 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 c006a623e73d2368ec653e19c769706885161053) Co-authored-by: Aalaap Dey <65075436+axdeyy@users.noreply.github.com>
* [3.13] fix comment reference from man 7 signal to man 7 signal-safety ↵Miss Islington (bot)2025-09-062-2/+2
| | | | | | | | | | | (GH-138554) (#138595) fix comment reference from man 7 signal to man 7 signal-safety (GH-138554) (cherry picked from commit 2f5ace780ba3880ce07c4aacbda08ebba36e3b4d) docs: fix comment reference from man 7 signal to man 7 signal-safety Co-authored-by: mqudah <mohghq@gmail.com>
* [3.13] gh-116946: fully implement GC protocol for `_curses_panel.panel` ↵Bénédikt Tran2025-09-061-13/+76
| | | | | | | | | (GH-138333) (#138428) [3.14] gh-116946: fully implement GC protocol for `_curses_panel.panel` (GH-138333) This commit fixes possible reference loops via `panel.set_userptr` by implementing `tp_clear` and `tp_traverse` for panel objects. (cherry picked from commit 572df47840d910b9fc9cd951074232ae89442be1)
* [3.13] gh-60462: Fix locale.strxfrm() on Solaris (GH-138242) (GH-138449)Miss Islington (bot)2025-09-031-1/+48
| | | | | | | | 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 482fd0c811a366f25bd076fc73bf37ffb6b3081e) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.13] gh-138204: Forbid expansion of a shared anonymous mmap on Linux ↵Miss Islington (bot)2025-09-031-0/+9
| | | | | | | | | (GH-138220) (GH-138387) This is a Linux kernel bug which caused a bus error. https://bugzilla.kernel.org/show_bug.cgi?id=8691 (cherry picked from commit 33fcb0c4a054f646d9d3686c145209a893b09bb0) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.13] gh-116946: Revert GC protocol for immutable empty heap types ↵Bénédikt Tran2025-09-013-102/+44
| | | | | | | | | | | | | | | (GH-138322, GH-138323, GH-138326) (#138337) * Revert "[3.13] gh-116946: fully implement GC protocol for `bz2` objects (GH-138266) (#138322)" This reverts commit 90036f51fe4bb2eed0e5161f26712cf08e1563d2. * Revert "[3.13] gh-116946: fully implement GC protocol for `lzma` objects (GH-138288) (#138323)" This reverts commit 828682df868217788cda695a21bb63635f6fadc7. * Revert "[3.13] gh-116946: fully implement GC protocol for `_hashlib` objects (GH-138289) (#138326)" This reverts commit 21b593219ad5cf444553afaebe12ff9137d4d55e.
* [3.13] gh-116946: fully implement GC protocol for `zlib` objects (GH-138290) ↵Bénédikt Tran2025-09-011-19/+61
| | | | | (#138328) (cherry picked from commit 2a54acf3c3d9f388c3d878a17ea804a801affca9)
* [3.13] gh-116946: fully implement GC protocol for `_hashlib` objects ↵Bénédikt Tran2025-09-011-23/+68
| | | | | (GH-138289) (#138326) (cherry picked from commit 6f1dd9551a69c8c76d066a04e94db6dbc6c7597c)
* [3.13] gh-116946: fully implement GC protocol for `lzma` objects (GH-138288) ↵Bénédikt Tran2025-09-011-10/+17
| | | | | (#138323) (cherry picked from commit 3ea16f990f81e1e3b2892f1dfd213937b1df2a68)
* [3.13] gh-116946: fully implement GC protocol for `bz2` objects (GH-138266) ↵Bénédikt Tran2025-09-011-11/+17
| | | | | (#138322) (cherry picked from commit 9be91f6a20ed2fd9b491c3e779dc45c7392f60ca)
* [3.13] bpo-41839: Fix error checking in sched_get_priority_ functions ↵Miss Islington (bot)2025-08-271-5/+7
| | | | | | | (GH-22374) (GH-138202) (cherry picked from commit bbcb75c986c47887e6c0757e63d59cd7af544f39) Co-authored-by: Jakub Kulík <Kulikjak@gmail.com>
* [3.13] gh-137986: Fix and improve the csv functions docstrings (GH-137987) ↵Serhiy Storchaka2025-08-242-48/+35
| | | | | | | | | | (GH-138108) The csv.register_dialect() docstring no longer imply that it returns a dialect. All functions have now signatures. (cherry picked from commit aa1dbd4dde32951de2e7438b56d6761001604ee2) Co-authored-by: maurycy <5383+maurycy@users.noreply.github.com>
* [3.13] gh-87135: Hang non-main threads that attempt to acquire the GIL ↵Gregory P. Smith2025-08-171-0/+29
| | | | | | | | | | | | | | | | | | | | during finalization (GH-105805) (GH-137827) * [3.13] gh-87135: Hang non-main threads that attempt to acquire the GIL during finalization (GH-105805) Instead of surprise crashes and memory corruption, we now hang threads that attempt to re-enter the Python interpreter after Python runtime finalization has started. These are typically daemon threads (our long standing mis-feature) but could also be threads spawned by extension modules that then try to call into Python. This marks the `PyThread_exit_thread` public C API as deprecated as there is no plausible safe way to accomplish that on any supported platform in the face of things like C++ code with finalizers anywhere on a thread's stack. Doing this was the least bad option. (cherry picked from commit 8cc5aa47ee464ddfd8da5461edecf4a5c72df2ff) Co-authored-by: Jeremy Maitin-Shepard <jeremy@jeremyms.com> Co-authored-by: Gregory P. Smith <greg@krypto.org> * state "3.13.7 and earlier" * backport: do not add the deprecated marker * fix Py_IsFinalizing doc ref --------- Co-authored-by: Jeremy Maitin-Shepard <jeremy@jeremyms.com>
* [3.13] gh-137583: Only lock the SSL context, not the SSL socket (GH-137588) ↵Peter Bierma2025-08-122-17/+17
| | | | | | | (GH-137613) Fixes a deadlock introduced in 3.13.6. (cherry picked from commit 55788a90967e82a9ea05b45c06a293b46ec53d72)
* [3.13] gh-137044: Support large limit values in getrlimit() and setrlimit() ↵Miss Islington (bot)2025-08-072-45/+58
| | | | | | | | | | | (GH-137338) (GH-137507) * 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 baefaa6cba1d69efd2f930cdc56bca682c54b139) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.13] gh-132710: only use stable `_uuid.generate_time_safe()` to deduce MAC ↵Bénédikt Tran2025-08-051-8/+32
| | | | | | | | address (GH-132901) (#134704) This commit includes the original commit and the NEWS entry that was added separately. (cherry picked from commit 3bffada46728e51f84c41ecbb0d3722595693e63) (cherry picked from commit 9eb84d83e00070cec3cfe78f1d0c7a7a0fbef30f)
* [3.13] gh-135839: Fix `module_traverse` and `module_clear` in subinterp ↵sobolevn2025-08-042-8/+4
| | | | | modules (GH-135937) (GH-135943) (cherry picked from commit bcc2cbaa7f112323939e853ed69fd82f19568ccf)
* [3.13] gh-137273: Fix debug assertion failure in locale.setlocale() on ↵Miss Islington (bot)2025-08-011-0/+47
| | | | | | | | | Windows (GH-137300) (GH-137306) It happened when there were at least 16 characters after dot in the locale name. (cherry picked from commit 718e0c89ba0610bba048245028ac133bbf2d44c2) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.13] gh-134698: Hold a lock when the thread state is detached in ssl ↵Gregory P. Smith2025-07-272-48/+66
| | | | | | | | (GH-134724) (#137126) Lock when the thread state is detached. (cherry picked from commit e047a35b23c1aa69ab8d5da56f36319cec4d36b8) or really from the 3.14 backport fd565fdfc9c0001900d03d627e2fda83f1bcca90 Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
* [3.13] gh-126662: naming consistency for `signal.ItimerError` (GH-126712) ↵Miss Islington (bot)2025-07-271-1/+1
| | | | | | | | (#137123) gh-126662: naming consistency for `signal.ItimerError` (GH-126712) (cherry picked from commit d5fa437dfb50e2e47632cdc994e3257608688f30) Co-authored-by: Stephen Morton <git@tungol.org>
* [3.13] gh-136710: Fix bad indentation in `os.chdir` docstring (GH-136721)Zachary Ware2025-07-162-4/+4
| | | | | (cherry picked from commit bde808ad6ba5eee8a6201983cf071449d7ce7e39) Co-authored-by: Harmen Stoppels <harmenstoppels@gmail.com>
* [3.13] gh-136549: Fix signature of threading.excepthook() (GH-136559) ↵Miss Islington (bot)2025-07-121-1/+1
| | | | | | | (GH-136590) (cherry picked from commit be2c3d284ecce67474a260b8c37e2f1e0628a9cf) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.13] gh-136288: Fix error message in `_testcapi/vectorcall.c` (GH-136258) ↵Miss Islington (bot)2025-07-041-4/+4
| | | | | | | | | | (GH-136295) gh-136288: Fix error message in `_testcapi/vectorcall.c` (GH-136258) Use the %N format specifier instead of %s and `PyType_GetName`. (cherry picked from commit d1d5dce14f90d777608e4403d09079421ff55944) Co-authored-by: William S Fulton <wsf@fultondesigns.co.uk>
* [3.13] Fix comments for `heapq.siftup_max` (GH-135359) (#136233)Miss Islington (bot)2025-07-031-3/+3
| | | | | | | Fix comments for `heapq.siftup_max` (GH-135359) (cherry picked from commit 8f8bdf251a5f79d15ac2b1a6d19860033bf50c79) Co-authored-by: Alper <alperyoney@fb.com> Co-authored-by: mpage <mpage@meta.com>
* [3.13] gh-135607: remove null checking of weakref list in dealloc of ↵Victor Stinner2025-07-0119-49/+39
| | | | | | | | | | extension modules and objects (#135614) (#136126) gh-135607: remove null checking of weakref list in dealloc of extension modules and objects (#135614) (cherry picked from commit b1056c2a446b43452e457d5fd5f1bde66afd3883) Co-authored-by: Xuanteng Huang <44627253+xuantengh@users.noreply.github.com> Co-authored-by: Kumar Aditya <kumaraditya@python.org>
* [3.13] gh-108765: fix comment about macro definitions in `_stat.c` post ↵Miss Islington (bot)2025-06-271-2/+2
| | | | | | | | GH-108854 (GH-136027) (#136044) gh-108765: fix comment about macro definitions in `_stat.c` post GH-108854 (GH-136027) (cherry picked from commit 0141e7f9e66e5e5ac3949fb018dd6811cd630dca) Co-authored-by: Lee Dogeon <dev.moreal@gmail.com>
* [3.13] gh-135839: Fix `module_traverse` and `module_clear` in ↵sobolevn2025-06-251-4/+2
| | | | | `_interpchannelsmodule` (GH-135840) (#135919) (cherry picked from commit dd59c786cfb1018eb5abe877bfa7265ea9a3c2b9)
* [3.13] gh-135855: Raise TypeError When Passing Non-dict Object to ↵Brian Schubert2025-06-241-12/+10
| | | | | `_interpreters.set___main___attrs` (gh-135903) (cherry picked from commit 4e6f0d116e, AKA gh-135856)
* [3.13] gh-135698: Fix Cross-interpreter Queue.full() With Negative/Default ↵Eric Snow2025-06-231-2/+5
| | | | | | | | max_size (gh-135778) We weren't handling non-positive maxsize values (including the default) properly in Queue.full(). This change fixes that and adjusts an associated assert. (cherry picked from commit c5ea8e8, AKA gh-135724)
* [3.13] gh-135641: Fix flaky `test_capi.test_lock_two_threads` test case ↵Miss Islington (bot)2025-06-181-1/+4
| | | | | | | | (gh-135642) (gh-135688) The mutex may have the `_Py_HAS_PARKED` bit set. (cherry picked from commit 17ac3933c3c860e08f7963cf270116a39a063be7) Co-authored-by: Sam Gross <colesbury@gmail.com>
* [3.13] gh-135321: Always raise a correct exception for BINSTRING argument > ↵Miss Islington (bot)2025-06-111-5/+4
| | | | | | | | 0x7fffffff in pickle (GH-135322) (GH-135383) (cherry picked from commit 2b8b4774d29a707330d463f226630185cbd3ceff) Co-authored-by: Justin Applegate <70449145+Legoclones@users.noreply.github.com> Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.13] gh-135326: Restore support of __index__ in random.getrandbits() (#135332)Serhiy Storchaka2025-06-102-8/+14
|
* [3.13] gh-134160: Use PyModuleDef.m_free in the example module xxlimited ↵Miss Islington (bot)2025-06-071-3/+8
| | | | | | | | | (GH-135174) (GH-135214) gh-134160: Use PyModuleDef.m_free in the example module xxlimited (GH-135174) (cherry picked from commit 1adca08d658ee2d520f3193960eaf3ae2ead1cef) Co-authored-by: Petr Viktorin <encukou@gmail.com> Co-authored-by: neonene <53406459+neonene@users.noreply.github.com>
* [3.13] gh-131884: Fix incorrect formatting in json.dumps() when using indent ↵Serhiy Storchaka2025-06-051-5/+10
| | | | | | | and skipkeys=True (GH-132200) (GH-135061) (cherry picked from commit ec12559ebafca01ded22c9013de64abe535c838d) Co-authored-by: Roei Ben Artzi <155478676+roeibenartzi@users.noreply.github.com>
* [3.13] gh-135108: Fix utmp.h inclusion in posixmodule.c on NetBSD ↵Miss Islington (bot)2025-06-041-3/+3
| | | | | | | (GH-135109) (GH-135128) (cherry picked from commit 5b3865418ceb1448bfbf15cddf52c900cd5882a3) Co-authored-by: Furkan Onder <furkanonder@protonmail.com>
* [3.13] gh-127081: use `getlogin_r` if available (gh-132751) (#135098)Sam Gross2025-06-031-0/+18
| | | | | | | The `getlogin` function is not thread-safe: replace with `getlogin_r` where available. (cherry picked from commit 1ffe913c2017b44804aca18befd45689df06c069) Co-authored-by: Duane Griffin <duaneg@dghda.com>
* [3.13] gh-133489: Remove size restrictions on getrandbits() and randbytes() ↵Serhiy Storchaka2025-06-022-16/+14
| | | | | | | (GH-133658) (GH-134965) random.getrandbits() can now generate more that 2**31 bits. random.randbytes() can now generate more that 256 MiB. (cherry picked from commit 68784fed78aa297f0de0d038742495709185bef5)
* [3.13] gh-134908: Protect `textiowrapper_iternext` with critical section ↵Sam Gross2025-06-021-1/+15
| | | | | | | | | (gh-134910) (gh-135040) The `textiowrapper_iternext` function called `_textiowrapper_writeflush`, but did not use a critical section, making it racy in free-threaded builds. (cherry picked from commit 44fb7c361cb24dcf9989a7a1cfee4f6aad5c81aa) Co-authored-by: Duane Griffin <duaneg@dghda.com>