summaryrefslogtreecommitdiffstats
path: root/Modules
Commit message (Collapse)AuthorAgeFilesLines
* [3.9] gh-99612: Fix PyUnicode_DecodeUTF8Stateful() for ASCII-only data ↵Serhiy Storchaka2023-08-221-1/+36
| | | | | | | (GH-99613) (GH-107224) (#107231) Previously *consumed was not set in this case. (cherry picked from commit f08e52ccb027f6f703302b8c1a82db9fd3934270). (cherry picked from commit b8b3e6afc0a48c3cbb7c36d2f73e332edcd6058c)
* [3.9] gh-103142: Upgrade binary builds and CI to OpenSSL 1.1.1u (GH-105174) ↵Gregory P. Smith2023-06-052-2/+167
| | | | | | | | | | | | | | | (GH-105200) (#105205) Upgrade builds to OpenSSL 1.1.1u. Also updates _ssl_data_111.h from OpenSSL 1.1.1u, _ssl_data_300.h from 3.0.9. Manual edits to the _ssl_data_300.h file prevent it from removing any existing definitions in case those exist in some peoples builds and were important (avoiding regressions during backporting). (cherry picked from commit ede89af) Co-authored-by: Ned Deily <nad@python.org>
* [3.9] GH-100892: Fix race in clearing `threading.local` (GH-100922) (#100939)Kumar Aditya2023-01-202-13/+58
| | | | | | | | | [3.9] [3.10] GH-100892: Fix race in clearing `threading.local` (GH-100922). (cherry picked from commit 762745a124cbc297cf2fe6f3ec9ca1840bb2e873) Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>. (cherry picked from commit 683e9fe30ecd024f5508b2a33316752870100a96) Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
* [3.9] gh-98517: Fix buffer overflows in _sha3 module (GH-98519) (#98526)Miss Islington (bot)2022-10-281-7/+8
| | | | | | | | | | | | | This is a port of the applicable part of XKCP's fix [1] for CVE-2022-37454 and avoids the segmentation fault and the infinite loop in the test cases published in [2]. [1]: https://github.com/XKCP/XKCP/commit/fdc6fef075f4e81d6b1bc38364248975e08e340a [2]: https://mouha.be/sha-3-buffer-overflow/ Regression test added by: Gregory P. Smith [Google LLC] <greg@krypto.org> (cherry picked from commit 0e4e058602d93b88256ff90bbef501ba20be9dd3) Co-authored-by: Theo Buehler <botovq@users.noreply.github.com>
* [3.9] gh-98739: Update libexpat from 2.4.9 to 2.5.0 (GH-98742) (#98786)Miss Islington (bot)2022-10-283-18/+35
| | | | | | | Update libexpat from 2.4.9 to 2.5.0 to address CVE-2022-43680. Co-authored-by: Shaun Walbridge <shaun.walbridge@gmail.com> (cherry picked from commit 3e07f827b359617664ad0880f218f17ae4483299)
* [3.9] gh-97897: Prevent os.mkfifo and os.mknod segfaults with macOS 13 SDK ↵Miss Islington (bot)2022-10-061-8/+52
| | | | | | | | | | | | | (GH-97944) (#97968) The macOS 13 SDK includes support for the `mkfifoat` and `mknodat` system calls. Using the `dir_fd` option with either `os.mkfifo` or `os.mknod` could result in a segfault if cpython is built with the macOS 13 SDK but run on an earlier version of macOS. Prevent this by adding runtime support for detection of these system calls ("weaklinking") as is done for other newer syscalls on macOS. (cherry picked from commit 6d0a0191a4e5477bd843e62c24d7f3bcad4fd5fc) Co-authored-by: Ned Deily <nad@python.org>
* [3.9] gh-97005: Update libexpat from 2.4.7 to 2.4.9 (gh-97006) (gh-97012)Miss Islington (bot)2022-10-047-17/+27
| | | | | | | | | gh-97005: Update libexpat from 2.4.7 to 2.4.9 (gh-97006) Co-authored-by: Gregory P. Smith [Google] <greg@krypto.org> (cherry picked from commit 10e3d398c31cc1695752fc52bc6ca2ce9ef6237e) Co-authored-by: Dong-hee Na <donghee.na@python.org> Co-authored-by: Ned Deily <nad@python.org>
* gh-94821: Fix autobind of empty unix domain address (GH-94826) (GH-94875)Miss Islington (bot)2022-07-261-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When binding a unix socket to an empty address on Linux, the socket is automatically bound to an available address in the abstract namespace. >>> s = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) >>> s.bind("") >>> s.getsockname() b'\x0075499' Since python 3.9, the socket is bound to the one address: >>> s.getsockname() b'\x00' And trying to bind multiple sockets will fail with: Traceback (most recent call last): File "/home/nsoffer/src/cpython/Lib/test/test_socket.py", line 5553, in testAutobind s2.bind("") OSError: [Errno 98] Address already in use Added 2 tests: - Auto binding empty address on Linux - Failing to bind an empty address on other platforms Fixes f6b3a07b7df6 (bpo-44493: Add missing terminated NUL in sockaddr_un's length (GH-26866) (cherry picked from commit c22f134211743cd5ad14cec1dd4f527bee542b4c) Co-authored-by: Nir Soffer <nsoffer@redhat.com>
* Check result of utc_to_seconds and skip fold probe in pure Python (GH-91582) ↵Miss Islington (bot)2022-05-161-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (GH-92748) The `utc_to_seconds` call can fail, here's a minimal reproducer on Linux: TZ=UTC python -c "from datetime import *; datetime.fromtimestamp(253402300799 + 1)" The old behavior still raised an error in a similar way, but only because subsequent calculations happened to fail as well. Better to fail fast. This also refactors the tests to split out the `fromtimestamp` and `utcfromtimestamp` tests, and to get us closer to the actual desired limits of the functions. As part of this, we also changed the way we detect platforms where the same limits don't necessarily apply (e.g. Windows). As part of refactoring the tests to hit this condition explicitly (even though the user-facing behvior doesn't change in any way we plan to guarantee), I noticed that there was a difference in the places that `datetime.utcfromtimestamp` fails in the C and pure Python versions, which was fixed by skipping the "probe for fold" logic for UTC specifically — since UTC doesn't have any folds or gaps, we were never going to find a fold value anyway. This should prevent some failures in the pure python `utcfromtimestamp` method on timestamps close to 0001-01-01. There are two separate news entries for this because one is a potentially user-facing change, the other is an internal code correctness change that, if anything, changes some error messages. The two happen to be coupled because of the test refactoring, but they are probably best thought of as independent changes. Fixes GH-91581 (cherry picked from commit 83c0247d47b99f4571e35ea95361436e1d2a61cd) Co-authored-by: Paul Ganssle <1377457+pganssle@users.noreply.github.com>
* bpo-46785: Fix race condition between os.stat() and unlink on Windows (GH-31858)Itai Steinherz2022-05-091-1/+11
| | | | | | * [3.9] bpo-46785: Fix race condition between os.stat() and unlink on Windows (GH-31858). (cherry picked from commit 39e6b8ae6a5b49bb23746fdcc354d148ff2d98e3) Co-authored-by: Itai Steinherz <itaisteinherz@gmail.com>
* [3.9] gh-80254: Disallow recursive usage of cursors in `sqlite3` converters ↵Erlend Egeberg Aasland2022-05-051-14/+32
| | | | | | | | | | | | | | (#92278) * [3.9] gh-80254: Disallow recursive usage of cursors in `sqlite3` converters (cherry picked from commit c908dc5b4798c311981bd7e1f7d92fb623ee448b) Co-authored-by: Sergey Fedoseev <fedoseev.sergey@gmail.com> Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com> * Fix ref leak in pysqlite_cursor_iternext * Explicitly free resources at test tearDown()
* gh-92036: Fix gc_fini_untrack() (GH-92037)Miss Islington (bot)2022-05-041-0/+6
| | | | | | | | | | | Fix a crash in subinterpreters related to the garbage collector. When a subinterpreter is deleted, untrack all objects tracked by its GC. To prevent a crash in deallocator functions expecting objects to be tracked by the GC, leak a strong reference to these objects on purpose, so they are never deleted and their deallocator functions are not called. (cherry picked from commit 14243369b5f80613628a565c224bba7fb3fcacd8) Co-authored-by: Victor Stinner <vstinner@python.org>
* [3.9] gh-91583: AC: Fix regression for functions with defining_class ↵Serhiy Storchaka2022-05-032-40/+82
| | | | | | | | (GH-91739) (GH-92080) Argument Clinic now generates the same efficient code as before adding the defining_class parameter. (cherry picked from commit a055dac0b45031878a8196a8735522de018491e3)
* gh-91734: Fix ossaudio support on Solaris (GH-91735)Miss Islington (bot)2022-04-201-0/+4
| | | | | (cherry picked from commit 4420faf273e9e2d03226a9375e1e04a336230c84) Co-authored-by: Jakub Kulík <Kulikjak@gmail.com>
* [3.9] gh-91118: Fix docstrings that do not honor --without-doc-strings ↵Oleg Iarygin2022-04-195-46/+46
| | | | | | | | (GH-31769) (#91664) Co-authored-by: Éric <merwok@netwok.org> Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com> (cherry picked from commit a573cb2fec664c645ab744658d7e941d72e1a398)
* [3.9] bpo-44493: Add missing terminated NUL in sockaddr_un's length ↵Miss Islington (bot)2022-03-281-1/+6
| | | | | | | | | | | | | | | | (GH-26866) (GH-32140) (GH-32156) Add missing terminated NUL in sockaddr_un's length - Linux: https://man7.org/linux/man-pages/man7/unix.7.html - *BSD: SUN_LEN (cherry picked from commit f6b3a07b7df60dc04d0260169ffef6e9796a2124) Co-authored-by: ty <zonyitoo@users.noreply.github.com> Automerge-Triggered-By: GH:gpshead (cherry picked from commit 5944807b09717d43bb017f700e8c451dd07199ed) Co-authored-by: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
* bpo-47101: list only activated algorithms in hashlib.algorithms_available ↵Miss Islington (bot)2022-03-231-1/+12
| | | | | | | (GH-32076) (cherry picked from commit 48e2010d92076b472922fa632fffc98ee150004f) Co-authored-by: Christian Heimes <christian@python.org>
* bpo-23691: Protect the re.finditer() iterator from re-entering (GH-32012)Miss Islington (bot)2022-03-212-4/+41
| | | | | (cherry picked from commit 08eb754d840696914928355014c2d424131f8835) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* bpo-38256: Fix binascii.crc32 large input. (GH-32000) (GH-32013) (GH-32015)Gregory P. Smith2022-03-211-9/+13
| | | | | | | Inputs >= 4GiB to `binascii.crc32(...)` when compiled to use the zlib crc32 implementation (the norm on POSIX) no longer return the wrong result. (cherry picked from commit 4c989e19c84ec224655bbbde9422e16d4a838a80)
* [3.9] bpo-46968: Check for 'sys/auxv.h' in the configure script (GH-31961). ↵Pablo Galindo Salgado2022-03-181-3/+3
| | | | | | | (GH-31975) (cherry picked from commit 8e3fde728f547f1d32bde8adf62b4c50bb877b9d) Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
* [3.9] sqlite3: normalise pre-acronym determiners (GH-31772) (GH-31807)Jelle Zijlstra2022-03-121-2/+2
| | | | | | | For consistency, replace "a SQL" with "an SQL".. (cherry picked from commit 2d5835a019a46573d5b1b614c8ef88d6b564d8d4) Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
* bpo-46968: Fix faulthandler for Sapphire Rapids Xeon (GH-31789) (GH-31831)Victor Stinner2022-03-111-6/+20
| | | | | | | | | | | | | | | In Linux kernel 5.14 one can dynamically request size of altstacksize based on hardware capabilities with getauxval(AT_MINSIGSTKSZ). This changes allows for Python extension's request to Linux kernel to use AMX_TILE instruction set on Sapphire Rapids Xeon processor to succeed, unblocking use of the ISA in frameworks. Introduced HAVE_LINUX_AUXVEC_H in configure.ac and pyconfig.h.in Used cpython_autoconf:269 docker container to generate configure. (cherry picked from commit 3b128c054885fe881c3b57a5978de3ea89c81a9c) Co-authored-by: Oleksandr Pavlyk <oleksandr.pavlyk@intel.com>
* [3.9] Docstring: replace pysqlite with sqlite3 (GH-31758) (GH-31778)Jelle Zijlstra2022-03-091-3/+3
| | | | | | | Replace two instances of "pysqlite" with "sqlite3" in sqlite3 docstrings. Also reword "is a no-op" to "does nothing" for clarity.. (cherry picked from commit b33a1ae703338e09dc0af5fbfd8ffa01d3ff75da) Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
* [3.9] bpo-46878: Purge 'non-standard' from sqlite3 docstrings (GH-31612) ↵Erlend Egeberg Aasland2022-03-084-23/+22
| | | | | (GH-31754) (cherry picked from commit 4d95fa1ac5d31ff450fb2f31b55ce1eb99d6efcb)
* bpo-46932: Update bundled libexpat to 2.4.7 (GH-31736)Miss Islington (bot)2022-03-072-14/+155
| | | | | (cherry picked from commit 176835c3d5c70f4c1b152cc2062b549144e37094) Co-authored-by: Steve Dower <steve.dower@python.org>
* bpo-25415: Remove confusing sentence from IOBase docstrings (PR-31631)Miss Islington (bot)2022-03-042-3/+2
| | | | | (cherry picked from commit cedd2473a9bebe07f3ced4f341cf58a2fef07b03) Co-authored-by: slateny <46876382+slateny@users.noreply.github.com>
* bpo-46913: Fix test_ctypes, test_hashlib, test_faulthandler on UBSan ↵Victor Stinner2022-03-041-3/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (GH-31675) (GH-31676) * bpo-46913: Fix test_faulthandler.test_sigfpe() on UBSAN (GH-31662) Disable undefined behavior sanitizer (UBSAN) on faulthandler_sigfpe(). (cherry picked from commit 4173d677a1d7c72bb32d292fbff1b4cf073d615c) * bpo-46913: Fix test_faulthandler.test_read_null() on UBSan (GH31672) Disable undefined behavior sanitizer (UBSan) on faulthandler._read_null(). (cherry picked from commit 65b92ccdec2ee4a99e54aaf7ae2d9bbc2ebfe549) * bpo-46913: test_hashlib skips _sha3 tests on UBSan (GH-31673) If Python is built with UBSan, test_hashlib skips tests on the _sha3 extension which currently has undefined behaviors. This change allows to run test_hashlib to check for new UBSan regression, but the known _sha3 undefined behavior must be fixed. (cherry picked from commit 6d0d7d2b8c1e04fd51c6cb29cc09a41b60b97b7b) * bpo-46913: Skip test_ctypes.test_shorts() on UBSan (GH-31674) If Python is built with UBSan, test_ctypes now skips test_shorts(). This change allows to run test_ctypes to check for new UBSan regression, but the known test_shorts() undefined behavior must be fixed. (cherry picked from commit ad1b04451d3aca2c6fa6dbe2891676a4e0baac49) (cherry picked from commit 7b5b429adab4fe0fe81858fe3831f06adc2e2141)
* [3.9] bpo-43853: Expand test suite for SQLite UDF's (GH-27642) (GH-31030) ↵Erlend Egeberg Aasland2022-03-022-3/+14
| | | | | (GH-31586) (cherry picked from commit 3eb3b4f270757f66c7fb6dcf5afa416ee1582a4b)
* bpo-46794: Bump up the libexpat version into 2.4.6 (GH-31487)Miss Islington (bot)2022-02-235-62/+132
| | | | | (cherry picked from commit 1935e1cc284942bec8006287c939e295e1a7bf13) Co-authored-by: Dong-hee Na <donghee.na@python.org>
* bpo-46784: Add newly exported expat symbols to the namespace. (GH-31397)Miss Islington (bot)2022-02-181-0/+5
| | | | | | | | | | | | | | | | | | The libexpat 2.4.1 upgrade from introduced the following new exported symbols: * `testingAccountingGetCountBytesDirect` * `testingAccountingGetCountBytesIndirect` * `unsignedCharToPrintable` * `XML_SetBillionLaughsAttackProtectionActivationThreshold` * `XML_SetBillionLaughsAttackProtectionMaximumAmplification` We need to adjust [Modules/expat/pyexpatns.h](https://github.com/python/cpython/blob/master/Modules/expat/pyexpatns.h) (The newer libexpat upgrade has no new symbols). Automerge-Triggered-By: GH:gpshead (cherry picked from commit 6312c1052c0186b4596fc45c42fd3ade9f8f5911) Co-authored-by: Yilei "Dolee" Yang <yileiyang@google.com>
* bpo-46400: Update libexpat from 2.4.1 to 2.4.4 (GH-31022) (GH-31295)Miss Islington (bot)2022-02-175-31/+237
|
* [3.9] bpo-46728: fix docstring of combinations_with_replacement for ↵DongGeon Lee2022-02-152-4/+4
| | | | consistency (GH-31293). (GH-31356)
* [3.9] bpo-45948: Remove constructor discrepancy in C version of ↵Jacob Walls2022-02-132-5/+5
| | | | | | | | ElementTree.XMLParser (GH-31152) (GH-31299) Both implementations accept target=None now. (cherry picked from commit 168fd6453b5de15236116f9261d64601d92571ac)
* bpo-40479: Fix undefined behavior in Modules/_hashopenssl.c (GH-31153)Miss Islington (bot)2022-02-071-0/+1
| | | | | | va_end() must be called before returning. (cherry picked from commit 59e004af63742361b67d1e1ae70229ff0db1059d) Co-authored-by: Zackery Spytz <zspytz@gmail.com>
* [3.9] bpo-46513: Remove AC_C_CHAR_UNSIGNED / __CHAR_UNSIGNED__ (GH-30851) ↵Christian Heimes2022-01-261-7/+0
| | | | | (GH-30915) Co-authored-by: Christian Heimes <christian@python.org>
* [3.9] bpo-46469: Make asyncio generic classes return GenericAlias (GH-30777) ↵Kumar Aditya2022-01-221-16/+2
| | | | | (GH-30785) Automerge-Triggered-By: GH:asvetlov
* [3.9] bpo-46383: Fix signature of zoneinfo module_free function (GH-3… ↵Kumar Aditya2022-01-221-1/+1
| | | | | (GH-30611) …0607)
* [3.9] bpo-41857: mention timeout argument units in select.poll() and ↵Tal Einat2022-01-212-3/+15
| | | | | | | select.depoll() doc-strings (GH-22406) (cherry picked from commit 27df7566bc19699b967e0e30d7808637b90141f6) Co-authored-by: Zane Bitter <zbitter@redhat.com>
* bpo-46280: Fix tracemalloc_copy_domain() (GH-30591)Miss Islington (bot)2022-01-141-0/+3
| | | | | | | Test if tracemalloc_copy_traces() failed to allocated memory in tracemalloc_copy_domain(). (cherry picked from commit 7c770d3350813a82a639fcb3babae0de2b87aaae) Co-authored-by: Victor Stinner <vstinner@python.org>
* bpo-40479: Fix typo, flag must be set for OpenSSL < 3.0.0 (GH-30584)Miss Islington (bot)2022-01-131-1/+1
| | | | | (cherry picked from commit 276c234ce0fa6732237f1b187989837324d9dea3) Co-authored-by: Christian Heimes <christian@python.org>
* bpo-46070: _PyGC_Fini() untracks objects (GH-30577) (GH-30580)Victor Stinner2022-01-131-0/+24
| | | | | | | | | Py_EndInterpreter() now explicitly untracks all objects currently tracked by the GC. Previously, if an object was used later by another interpreter, calling PyObject_GC_UnTrack() on the object crashed if the previous or the next object of the PyGC_Head structure became a dangling pointer. (cherry picked from commit 1a4d1c1c9b08e75e88aeac90901920938f649832)
* [3.9] bpo-40479: Fix hashlib's usedforsecurity for OpenSSL 3.0.0 (GH-30455) ↵Christian Heimes2022-01-131-219/+354
| | | | | (GH-30574) Co-authored-by: Christian Heimes <christian@python.org>
* bpo-46070: Fix asyncio initialisation guard (GH-30423)Miss Islington (bot)2022-01-071-6/+4
| | | | | | | If init flag is set, exit successfully immediately. If not, only set the flag after successful initialization. (cherry picked from commit b127e70a8a682fe869c22ce04c379bd85a00db67) Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
* bpo-45822: Minor cleanups to the test_Py_CompileString test (GH-29750) ↵Miss Islington (bot)2021-12-111-1/+1
| | | | | | | (GH-29759) (cherry picked from commit abfc794bbf2c6a0939ddd81b6e700c46944ba87a) Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
* bpo-46000: Improve NetBSD curses compatibility (GH-29947) (GH-30023)Miss Islington (bot)2021-12-101-2/+2
| | | | | | (cherry picked from commit 2fb797e93c6bbd44dfcbe23f63acfa240a87e48a) Co-authored-by: Thomas Klausner <tk@giga.or.at>
* bpo-46018: Ensure that math.expm1 does not raise on underflow (GH-29997)Miss Islington (bot)2021-12-091-2/+6
| | | | | (cherry picked from commit 3363e1cb05d0d19ed172ea63606d8cb6268747fc) Co-authored-by: Steve Dower <steve.dower@python.org>
* bpo-27946: Fix possible crash in ElementTree.Element (GH-29915)Miss Islington (bot)2021-12-051-13/+10
| | | | | | | Getting an attribute via attrib.get() simultaneously with replacing the attrib dict can lead to access to deallocated dict. (cherry picked from commit d15cdb2f32f572ce56d7120135da24b9fdce4c99) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.9] bpo-41735: Fix thread lock in zlib.Decompress.flush() may go wrong ↵Ma Lin2021-11-271-3/+5
| | | | | | | | (GH-29588) * Fix thread lock in zlib.Decompress.flush() may go wrong Getting `.unconsumed_tail` before acquiring the thread lock may mix up decompress state. backport of https://github.com/python/cpython/pull/29587 to 3.9/3.8.
* [3.9] bpo-41498: Fix build on platforms without sigset_t (GH-29770) (GH-29774)Christian Heimes2021-11-254-18/+31
| | | Co-authored-by: Christian Heimes <christian@python.org>
* bpo-45822: Respect PEP 263's coding cookies in the parser even if flags are ↵Pablo Galindo Salgado2021-11-171-0/+14
| | | | | not provided (GH-29582) (GH-29585) (cherry picked from commit da20d7401de97b425897d3069f71f77b039eb16f)