summaryrefslogtreecommitdiffstats
path: root/Modules
Commit message (Collapse)AuthorAgeFilesLines
* [3.13] gh-140042: Removing unsafe call to sqlite3_shutdown (GH-141793) (#141812)Prithviraj Chaudhuri2025-11-301-1/+0
|
* [3.13] gh-141801: Use accessors for ASN1_STRING fields in libssl (GH-141802) ↵Miss Islington (bot)2025-11-221-8/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | (#141848) gh-141801: Use accessors for ASN1_STRING fields in libssl (GH-141802) * gh-141801: Use accessors for ASN1_STRING fields While ASN1_STRING is currently exposed, it is better to use the accessors. See https://github.com/openssl/openssl/issues/29117 where, if the type were opaque, OpenSSL's X509 objects could be much more memory-efficient. * Update Modules/_ssl.c * Update Modules/_ssl.c --------- (cherry picked from commit c41fce08a5d7aae8fd9e3fa25e0ba521600e097c) Co-authored-by: David Benjamin <davidben@davidben.net> Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
* [3.13] gh-141659: Fix bad file descriptor error in subprocess on AIX ↵Hugo van Kemenade2025-11-211-0/+6
| | | | | | (GH-141660) (#141828) Co-authored-by: Ayappan Perumal <ayappap2@in.ibm.com>
* [3.13] gh-137109: refactor warning about threads when forking (GH-141438) ↵Miss Islington (bot)2025-11-171-43/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | (GH-141614) (GH-141639) [3.14] gh-137109: refactor warning about threads when forking (GH-141438) (GH-141614) This splits the OS API specific functionality to get the number of threads out from the fallback Python method and warning raising code itself. This way the OS APIs can be queried before we've run `os.register_at_fork(after_in_parent=...)` registered functions which themselves may (re)start threads that would otherwise be detected. This is best effort. If the OS APIs are either unavailable or fail, the warning generating code still falls back to looking at the Python threading state after the CPython interpreter world has been restarted and the after_in_parent calls have been made. The common case for most Linux and macOS environments should work today. This also lines up with the existing TODO refactoring, we may choose to expose this API to get the number of OS threads in the `os` module in the future. Note: This is a simplified backport that maintains the void return type for warn_about_fork_with_threads() and keeps PyErr_Clear() in the warning path, as the error handling changes from fd8f42d3d1 are not needed in 3.14. (cherry picked from commit 0d8fb0b8523769e24f249d19dab3781a10b50e8b) Co-authored-by: Gregory P. Smith <68491+gpshead@users.noreply.github.com>
* [3.13] gh-124111: Fix TCL 9 thread detection (GH-141483)Miss Islington (bot)2025-11-121-0/+4
| | | | | (cherry picked from commit dc0987080ed66c662e8e0b24cdb8c179817bd697) Co-authored-by: Michael Cho <michael@michaelcho.dev>
* [3.13] gh-141311: Avoid assertion in BytesIO.readinto() (GH-141333) (GH-141478)Cody Maloney2025-11-121-4/+14
| | | | | | Fix error in assertion which causes failure if pos is equal to PY_SSIZE_T_MAX. Fix undefined behavior in read() and readinto() if pos is larger that the size of the underlying buffer. (cherry picked from commit 7d54374f9c7d91e0ef90c4ad84baf10073cf1d8a)
* [3.13] gh-132657: add regression test for `PySet_Contains` with unhashable ↵Miss Islington (bot)2025-11-121-0/+47
| | | | | | | | type (GH-141411) (#141467) gh-132657: add regression test for `PySet_Contains` with unhashable type (GH-141411) (cherry picked from commit 2ac738d325a6934e39fecb097f43d4d4ed97a2b9) Co-authored-by: M Bussonnier <bussonniermatthias@gmail.com>
* [3.13] gh-141314: Fix TextIOWrapper.tell() assertion failure with standalone ↵Mohsin Mehmood2025-11-121-1/+1
| | | | | | carriage return (GH-141331) (GH-141452) The assertion was checking wrong variable (skip_back vs skip_bytes). (cherry picked from commit af80fac42548719ede7241bfbab3c2c0775b4760)
* [3.13] gh-100218: correctly set `errno` when ↵Bénédikt Tran2025-11-091-2/+3
| | | | | | | | `socket.if_{nametoindex,indextoname}` raise `OSError` (GH-140905) (#141285) Previously, socket.if_nametoindex() and socket.if_indextoname() could raise an `OSError` with a `None` errno. Now, the errno from libc is propagated. (cherry picked from commit 3ce2d57b2f02030353af314d89c5f6215d2f5c96)
* [3.13] gh-140615: Update docstrings in the fcntl module (GH-140619) ↵Serhiy Storchaka2025-11-082-90/+102
| | | | | | | | | (GH-141231) (GH-141232) * Refer to bytes objects or bytes-like objects instead of strings. * Remove backticks -- they do not have effect on formatting. * Re-wrap lines to ensure the pydoc output fits in 80 columns. (cherry picked from commit 610377056bad696915d70590429e68002bee9006) (cherry picked from commit 1a080199aff6d98b476ab19e409d7ca4d56cb3c6)
* [3.13] Fix a compiler warning in _randommodule.c (GH-141058) (#141064)Miss Islington (bot)2025-11-051-1/+1
| | | | | | | | | | | | | Fix a compiler warning in _randommodule.c (GH-141058) The test just before the cast ensures that the cast cannot overflow. Fix the warning on 32-bit Windows: Modules\_randommodule.c(525,28): warning C4244: '=': conversion from 'uint64_t' to 'Py_ssize_t', possible loss of data (cherry picked from commit 4ac16dd10950fad2d3e58e8b0ba5f2e621af3cc1) Co-authored-by: Victor Stinner <vstinner@python.org>
* [3.13] gh-140979: Fix off-by-one error in the RE code validator (GH-140984) ↵Miss Islington (bot)2025-11-041-1/+1
| | | | | | | | (GH-141000) It was too lenient and allowed MARK opcodes with too large value. (cherry picked from commit 1326d2a808245e5f2de9e515460bab30556e8f05) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.13] gh-90949: add Expat API to prevent XML deadly allocations ↵Sebastian Pipping2025-11-023-28/+316
| | | | | | | | | | | | | | | | | | (CVE-2025-59375) (GH-139234) (#139367) * gh-90949: add Expat API to prevent XML deadly allocations (CVE-2025-59375) (#139234) Expose the XML Expat 2.7.2 mitigation APIs to disallow use of disproportional amounts of dynamic memory from within an Expat parser (see CVE-2025-59375 for instance). The exposed APIs are available on Expat parsers, that is, parsers created by `xml.parsers.expat.ParserCreate()`, as: - `parser.SetAllocTrackerActivationThreshold(threshold)`, and - `parser.SetAllocTrackerMaximumAmplification(max_factor)`. (cherry picked from commit f04bea44c37793561d753dd4ca6e7cd658137553) (cherry picked from commit 68a1778b7721f3fb853cd3aa674f7039c2a4df36)
* [3.13] gh-140607: Validate returned byte count in RawIOBase.read (GH-140611) ↵Cody Maloney2025-10-291-3/+10
| | | | | | | | | | | | | | | | | | | | | (#140730) * [3.13] gh-140607: Validate returned byte count in RawIOBase.read (GH-140611) While `RawIOBase.readinto` should return a count of bytes between 0 and the length of the given buffer, it is not required to. Add validation inside RawIOBase.read() that the returned byte count is valid. (cherry picked from commit 0f0a362768aecb4c791724cce486d8317533a94d) Co-authored-by: Cody Maloney <cmaloney@users.noreply.github.com> Co-authored-by: Shamil <ashm.tech@proton.me> Co-authored-by: Victor Stinner <vstinner@python.org> * fixup: Use older attribute name --------- Co-authored-by: Shamil <ashm.tech@proton.me> Co-authored-by: Victor Stinner <vstinner@python.org>
* [3.13] GH-140590: Fix setstate for functools.partial C-module (GH-140671) ↵Miss Islington (bot)2025-10-281-1/+2
| | | | | | | | | | (#140699) GH-140590: Fix setstate for functools.partial C-module (GH-140671) (cherry picked from commit d26686a7f87d63499f7296c0811fa0535637a93b) Co-authored-by: Sergey Miryanov <sergey.miryanov@gmail.com> Co-authored-by: Mikhail Efimov <efimov.mikhail@gmail.com>
* [3.13] gh-140634: Fix a reference counting bug in ↵Miss Islington (bot)2025-10-271-1/+1
| | | | | | | os.sched_param.__reduce__() (GH-140667) (GH-140686) (cherry picked from commit 364ae607d8035db8ba92486ebebd8225446c1a90) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.13] gh-140593: Fix a memory leak in function `my_ElementDeclHandler` of ↵Sebastian Pipping2025-10-261-1/+1
| | | | | | | | | | | `pyexpat` (GH-140602) (#140630) [3.13] gh-140593: Fix a memory leak in function `my_ElementDeclHandler` of `pyexpat` (GH-140602) Ensure that the memory allocated for the content model passed to `my_ElementDeclHandler` is freed in all error paths. (cherry picked from commit e34a5e33049ce845de646cf24a498766a2da3586)
* [3.13] Remove unreachable break statements in _ctypes_test.c (GH-140585) ↵Miss Islington (bot)2025-10-251-3/+0
| | | | | | | | (#140588) Remove unreachable break statements in _ctypes_test.c (GH-140585) (cherry picked from commit 2a1c9bd616b1b3a07c74d280e3f7e2bd94d0cc22) Co-authored-by: Shamil <ashm.tech@proton.me>
* [3.13] gh-140474: Fix memory leak in `array.array` (GH-140478) (GH-140499)Miss Islington (bot)2025-10-231-0/+3
| | | | | | gh-140474: Fix memory leak in `array.array` (GH-140478) (cherry picked from commit aa9d0a61d5c48717454f36351f0aabe4cc532de5) Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
* [3.13] gh-140306: Fix memory leaks in cross-interpreter data handling ↵Serhiy Storchaka2025-10-202-2/+2
| | | | | | | (GH-140307) (GH-140357) (cherry picked from commit f9323213c98c9f1f7f3bf5af883b73047432fe50) Co-authored-by: Shamil <ashm.tech@proton.me>
* [3.13] gh-140272: Fix memory leak in _gdbm.gdbm.clear() (GH-140274) (GH-140289)Serhiy Storchaka2025-10-181-0/+2
| | | | | (cherry picked from commit f937468e7c88c768a28ff4e653da051ffa30d86c) Co-authored-by: Shamil <ashm.tech@proton.me>
* [3.13] gh-101828: Fix `jisx0213` codecs removing null characters (gh-139340) ↵Stan Ulbrych2025-10-142-6/+14
| | | | | | | | | | (gh-140112) * [3.13] gh-101828: Fix `jisx0213` codecs removing null characters (gh-139340) (cherry picked from commit 87eadce3e0309d80a95e85d70a00028b5dca9907) Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com> * Accidentally removed line
* [3.13] gh-102431: Clarify constraints on operands of Decimal logical ↵Sergey B Kirpichev2025-10-141-8/+80
| | | | | | | | | | operations (GH-102836) (#140106) * [3.13] 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 6ecf77dbdec7838e9ce2298cb8d16e8c2250da81) Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
* [3.13] gh-139748: Fix socket.if_nametoindex() Argument Clinic (#139815)Victor Stinner2025-10-082-4/+7
| | | | | gh-139748: Fix socket.if_nametoindex() Argument Clinic Fix a reference leak.
* [3.13] gh-139748: fix leaks in AC error paths when using unicode FS-b… ↵Kumar Aditya2025-10-086-37/+28
| | | | | | | | (#139792) * [3.13] gh-139748: fix leaks in AC error paths when using unicode FS-based converters (GH-139765) (cherry picked from commit b04a57deef66ce08233be57d1ab5873388df2cea) Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
* [3.13] gh-137920: Fix semantically relevant typo in `curses.window.attron` ↵Stan Ulbrych2025-10-072-4/+4
| | | | | | | (GH-137940) (GH-138507) Originally authored by: vict-Yang (cherry picked from commit ce70a57bc02fddc8cb18a08aaf1449fceb10d66e)
* [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>