summaryrefslogtreecommitdiffstats
path: root/Modules
Commit message (Collapse)AuthorAgeFilesLines
* [3.10] GH-97001: Release GIL in termios extension (GH-99503) (#99680)Ronald Oussoren2022-11-221-7/+46
| | | | | | Without releasing the GIL calls to termios APIs might block the entire interpreter.. (cherry picked from commit 959ba45d75953caa911e16b4c2a277978fc4b9b0) Co-authored-by: Ronald Oussoren <ronaldoussoren@mac.com>
* [3.10] gh-92119: ctypes: Print exception class name instead of its ↵Kamil Turek2022-11-131-1/+4
| | | | | | | representation (GH-98302) (#99452) gh-92119: ctypes: Print exception class name instead of its representation (#98302) (cherry picked from commit b9dedfe61dce2997e3e6be318d8c50b0c19c9394)
* gh-99275: Fix `SystemError` in `ctypes` during `__initsubclass__` (GH-99283)Miss Islington (bot)2022-11-131-1/+4
| | | | | (cherry picked from commit 343eb0f94b26f2a4c1c15505d417e8157ec19660) Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
* gh-96055: Update faulthandler to emit proper unexpect signal number (gh-99162)Miss Islington (bot)2022-11-071-4/+16
| | | | | (cherry picked from commit f626b7b504df454d289527a4f922b09deeae9e21) Co-authored-by: Dong-hee Na <donghee.na@python.org>
* gh-83004: Clean up refleak in _pickle initialisation (GH-98841)Miss Islington (bot)2022-11-061-7/+6
| | | | | (cherry picked from commit d3b82b4463c4eb51954c0afd98342f0c5e479baa) Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
* gh-83004: Clean up refleak in _zoneinfo initialisation (GH-98842)Miss Islington (bot)2022-11-061-2/+3
| | | | | (cherry picked from commit 31f2f6568d89564cc1d686cd6b75ba5578aaa748) Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
* gh-83004: Clean up refleak in _io initialisation (GH-98840)Miss Islington (bot)2022-11-031-3/+3
| | | | | (cherry picked from commit 1208037246eeab4c5c003f1651edfefb045e6fb7) Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
* [3.10] gh-98740: Fix validation of conditional expressions in RE (GH-98764) ↵Serhiy Storchaka2022-11-031-26/+28
| | | | | | | | | | | | | | | | (GH-99046) In very rare circumstances the JUMP opcode could be confused with the argument of the opcode in the "then" part which doesn't end with the JUMP opcode. This led to incorrect detection of the final JUMP opcode and incorrect calculation of the size of the subexpression. NOTE: Changed return value of functions _validate_inner() and _validate_charset() in Modules/_sre/sre.c. Now they return 0 on success, -1 on failure, and 1 if the last op is JUMP (which usually is a failure). Previously they returned 1 on success and 0 on failure. (cherry picked from commit e9ac890c0273aee413aa528cc202c3efa29f1d7a) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* GH-98897: fix memory leak if `math.dist` raises exception (GH-98898)Miss Islington (bot)2022-11-011-3/+3
| | | | | (cherry picked from commit ab575050709e2b313ca9a9585f09b6f4b0560318) Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
* [3.10] gh-98793: Fix typecheck in `overlapped.c` (GH-98835) (#98890)Charlie Zhao2022-10-312-9/+9
| | | | Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com> (cherry picked from commit 3ac8c0ab6ee819a14b1c8e0992acbaf376a46058)
* [3.10] GH-98671: bpo-46670: Fix #ifdef in sha3module.c (GH-90828) (#98677)samypr1002022-10-281-1/+1
|
* [3.10] bpo-2716: add license for audioop module (GH-19972) (#98532)Miss Islington (bot)2022-10-281-14/+30
| | | | | | bpo-2716: add license for audioop module (GH-19972) (cherry picked from commit 4c1145bb3796c550d477c8c154ff980d566fe4a2) Co-authored-by: Furkan Onder <furkanonder@protonmail.com>
* gh-98739: Update libexpat from 2.4.9 to 2.5.0 (GH-98742)Miss Islington (bot)2022-10-273-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) Co-authored-by: Shaun Walbridge <46331011+scdub@users.noreply.github.com>
* Fix readline.c compiler warning. (GH-98738)Miss Islington (bot)2022-10-261-1/+1
| | | | | | | | | | ``` Modules/readline.c:1260:37: warning: assigning to 'char *' from 'const char *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers] completer_word_break_characters = ^ ``` (cherry picked from commit 29b391b1378577825a658b14764a8ff3e0b5c958) Co-authored-by: Benjamin Peterson <benjamin@python.org>
* gh-94808: cover `PyMapping_HasKeyString` and `PyMapping_HasKey` (GH-98486)Miss Islington (bot)2022-10-261-0/+36
| | | | | (cherry picked from commit 5d30544485dc56ab999ad7656ef6559306fd013f) Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
* [3.10] gh-98517: Fix buffer overflows in _sha3 module (#98519)Theo Buehler2022-10-211-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>
* gh-98178: syslog() is not thread-safe on macOS (GH-98213)Miss Islington (bot)2022-10-131-0/+5
| | | | | | | | | On macOS, fix a crash in syslog.syslog() in multi-threaded applications. On macOS, the libc syslog() function is not thread-safe, so syslog.syslog() no longer releases the GIL to call it. (cherry picked from commit d4b91663857e85eab1f309cacec4d27b5f6657ec) Co-authored-by: Victor Stinner <vstinner@python.org>
* [3.10] Add more syslog tests (GH-97953). (GH-98101)Serhiy Storchaka2022-10-091-1/+1
| | | | (cherry picked from commit cae7d1d7a713f8267daf5e4f2fff5cb1dad02c7c)
* [3.10] gh-96288: Add a sentence to `os.mkdir`'s docstring. (GH-96271). (#98066)Jelle Zijlstra2022-10-082-4/+6
| | | | | (cherry picked from commit 1523c9e9d47e7d67e4889987ff0f38eb7b881fdd) Co-authored-by: Hagai Helman Tov <hagai.helman@gmail.com>
* gh-65496: Correct wording on csv's skipinitialspace argument (GH-96170)Miss Islington (bot)2022-10-071-4/+4
| | | | | (cherry picked from commit 676d8ef3806758bcd1d3fd84a746c8a9b64480d0) Co-authored-by: Stanley <46876382+slateny@users.noreply.github.com>
* fixes gh-96078: os.sched_yield release the GIL while calling sched_yield(2). ↵Miss Islington (bot)2022-10-071-1/+6
| | | | | | | (gh-97965) (cherry picked from commit b9d2e8171696514e9226164005f7bf24bf69e66d) Co-authored-by: Dong-hee Na <donghee.na@python.org>
* [3.10] gh-97897: Prevent os.mkfifo and os.mknod segfaults with macOS 13 SDK ↵Miss Islington (bot)2022-10-061-8/+52
| | | | | | | | | | | | | (GH-97944) (#97967) 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.10] gh-97728: Argument Clinic: Fix uninitialized variable in the ↵Serhiy Storchaka2022-10-033-12/+12
| | | | | | | | Py_UNICODE converter (GH-97729) (GH-97760) It affects function os.system() on Windows and Windows-specific modules winreg, _winapi, _overlapped, and _msi. (cherry picked from commit 0ee9619a4cba58730c45e65d22288fadbf7680de)
* GH-97592: Fix crash in C remove_done_callback due to evil code (GH-97660)Miss Islington (bot)2022-09-301-2/+7
| | | | | | Evil code could cause fut_callbacks to be cleared when PyObject_RichCompareBool is called. (cherry picked from commit 63780f4599acc2c5ee8af5f37ab76c162ad21065) Co-authored-by: Guido van Rossum <guido@python.org>
* gh-97005: Update libexpat from 2.4.7 to 2.4.9 (gh-97006)Miss Islington (bot)2022-09-227-17/+27
| | | | | | 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>
* gh-96821: Fix undefined behaviour in `_testcapimodule.c` (GH-96915) (GH-96926)Miss Islington (bot)2022-09-191-1/+3
| | | | | | | | | | * gh-96821: Assert for demonstrating undefined behaviour * Fix UB (cherry picked from commit cbdeda8ce7a3543cb3376d70e4cd46fcf24f42a7) Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM> Co-authored-by: Matthias Görgens <matthias.goergens@gmail.com>
* gh-96652: Fix faulthandler chained signal without sigaction() (GH-96666)Miss Islington (bot)2022-09-081-1/+1
| | | | | | | | Fix the faulthandler implementation of faulthandler.register(signal, chain=True) if the sigaction() function is not available: don't call the previous signal handler if it's NULL. (cherry picked from commit c580a81af91af4b9df85e466f8b48c3c9c86c3df) Co-authored-by: Victor Stinner <vstinner@python.org>
* gh-96641: Do not expose `KeyWrapper` in `_functoolsmodule.c` (gh-96642)Miss Islington (bot)2022-09-071-3/+2
| | | | | (cherry picked from commit 2fd7246e97c8cc09b4e3f22933693f9d68f08163) Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
* fixes gh-96292: Fix Trivial Typo in cpython/Modules/atexitmodule.c (GH-96327)Miss Islington (bot)2022-08-271-1/+1
| | | | | (cherry picked from commit 0ace820bec8892d621a4aadc1feb6c56e25560bf) Co-authored-by: Ansab Gillani <56605828+ansabgillani@users.noreply.github.com>
* gh-95878: Fix format char in datetime CAPI tests (GH-95879)Miss Islington (bot)2022-08-111-4/+4
| | | | | (cherry picked from commit 8b34e914bba2ccd6ae39609410db49d0beb19cb1) Co-authored-by: Christian Heimes <christian@python.org>
* gh-91838: Resolve HTTP links which redirect to HTTPS (GH-95642)Miss Islington (bot)2022-08-041-1/+1
| | | | | | | It updates links which redirect to HTTPS with different authority or path. (cherry picked from commit d0d0154443cafb2f0a2cdfb6a1267d80cce8388e) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.10] bpo-46053: Fix OSS audio support on NetBSD (GH-30065). (GH-95477)Thomas Klausner2022-07-311-0/+78
| | | | | (cherry picked from commit 2e7e3c4c109928870c1e33d8af36b78e92895594) Co-authored-by: Thomas Klausner <tk@giga.or.at>
* [3.10] GH-93899: fix checks for eventfd flags (GH-95170). (#95345)Kumar Aditya2022-07-282-10/+14
| | | | | (cherry picked from commit 4dd099bafff14639ef5d2185965016d8f253353f) Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
* GH-95045: gc untrack _lsprof.Profiler before deallocating it (GH-95315)Miss Islington (bot)2022-07-271-0/+1
| | | | | | Automerge-Triggered-By: GH:pablogsal (cherry picked from commit deacf391d7a1b3ab49bffa16088b3500fdb4c435) Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
* gh-95041: Fail syslog.syslog in case inner call to syslog.openlog fails ↵Miss Islington (bot)2022-07-261-1/+7
| | | | | | | (GH-95264) (cherry picked from commit b1f648efc56ff17e18ec2b7402d59a771b305004) Co-authored-by: Noam Cohen <noam@noam.me>
* gh-95041: Fix several minor issues in syslog.openlog() (GH-95058)Miss Islington (bot)2022-07-261-24/+33
| | | | | | | | | | | | | | * syslog_get_argv() swallows exceptions, but not in all cases. * if ident is non UTF-8 encodable, syslog.openlog() fails after setting the global reference to ident. Now the C string saved internally in the previous call to openlog() points to the freed memory. * PySys_Audit() can crash if ident is NULL. * There may be a race condition with syslog.syslog(), because the global reference to ident is decrefed before setting the new value. * Possible use of freed memory if syslog.openlog() is called while the GIL is released in syslog.syslog(). (cherry picked from commit 68c555a50a2b74731b0db0f4dcbf51b2c11d4853) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* gh-95095: Use SSL_CTX_get_max_proto_version instead of SSL_CTX_ctrl (GH-95096)Miss Islington (bot)2022-07-211-2/+2
| | | | | | | | | | The wrapper macros are more readable and match the form recommended in the OpenSSL documentation. They also slightly less error-prone, as the mapping of arguments to SSL_CTX_ctrl is not always clear. (Though in this case it's straightforward.) https://www.openssl.org/docs/man1.1.1/man3/SSL_CTX_get_max_proto_version.html (cherry picked from commit 936f71e5d4f50f2238b0320d44f7fb5f88e39809) Co-authored-by: David Benjamin <davidben@davidben.net>
* [3.10] gh-94930: skipitem() in getargs.c should return non-NULL on error ↵Miss Islington (bot)2022-07-191-2/+21
| | | | | | | | (GH-94931) (GH-94963) (cherry picked from commit 067f0da33506f70c36a67d5f3d8d011c8dae10c9) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* GH-91153: Handle mutating __index__ methods in bytearray item assignment ↵Miss Islington (bot)2022-07-191-0/+16
| | | | | | | (GH-94891) (cherry picked from commit f36589510b8708fa224d799d5b328deab558aa4e) Co-authored-by: Brandt Bucher <brandtbucher@microsoft.com>
* gh-94821: Fix autobind of empty unix domain address (GH-94826)Miss Islington (bot)2022-07-171-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>
* bpo-45924: Fix asyncio incorrect traceback when future's exception is raised ↵Miss Islington (bot)2022-07-111-0/+14
| | | | | | | | | multiple times (GH-30274) (#94748) (cherry picked from commit 86c1df18727568758cc329baddc1836e45664023) Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com> Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
* GH-94736: Fix _multiprocessing.SemLock subclassing (GH-94738)Miss Islington (bot)2022-07-111-4/+2
| | | | | | | | | | | | * fix allocator and deallocator * 📜🤖 Added by blurb_it. * code review Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com> (cherry picked from commit f5b76330cfb93e1ad1a77c71dafe719f6a808cec) Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
* gh-94637: Release GIL in SSLContext.set_default_verify_paths (GH-94658)Miss Islington (bot)2022-07-091-1/+5
| | | | | (cherry picked from commit 78307c7dc2352b6633138466debd4c10fae32970) Co-authored-by: Christian Heimes <christian@python.org>
* [3.10] gh-94321: Document sqlite3.PrepareProtocol (GH-94620) (#94671)Erlend Egeberg Aasland2022-07-071-0/+3
| | | | | (cherry picked from commit fb6dccae348b954d9f625031b54711a9a33da525) Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@protonmail.com>
* GH-94644: fix test_curses ref leak (GH-94647)Miss Islington (bot)2022-07-071-0/+1
| | | | | (cherry picked from commit 277f55cb04409ccdf651d43df5eb9dcb3ee3128c) Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
* [3.10] gh-94510: Raise on re-entrant calls to sys.setprofile and syssettrace ↵Pablo Galindo Salgado2022-07-051-1/+1
| | | | | | (GH-94511) (#94579) Co-authored-by: Łukasz Langa <lukasz@langa.pl>. Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
* [3.10] GH-89988: Fix memory leak in pickle.Pickler dispatch_table lookup ↵Kumar Aditya2022-06-281-1/+5
| | | | (GH-94298) (#94385)
* GH-94254: Make _struct module types immutable (GH-94269)Miss Islington (bot)2022-06-261-2/+4
| | | | | (cherry picked from commit 17ed560fcd0a1442485f9bd48884bbe412f35abc) Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
* [3.10] gh-90016: Reword sqlite3 adapter/converter docs (GH-93095) (#94273)Erlend Egeberg Aasland2022-06-252-11/+11
| | | | | | | Also add adapters and converter recipes. Co-authored-by: CAM Gerlach <CAM.Gerlach@Gerlach.CAM> Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com. (cherry picked from commit bd3c1c187e0e4fde5aec6835d180e9eddde8ceb6)
* [3.10] gh-94207: Fix struct module leak (GH-94239) (GH-94266)Miss Islington (bot)2022-06-251-2/+20
| | | | | | | | | | | | | | | | * gh-94207: Fix struct module leak (GH-94239) Make _struct.Struct a GC type This fixes a memory leak in the _struct module, where as soon as a Struct object is stored in the cache, there's a cycle from the _struct module to the cache to Struct objects to the Struct type back to the module. If _struct.Struct is not gc-tracked, that cycle is never collected. This PR makes _struct.Struct GC-tracked, and adds a regression test. (cherry picked from commit 6b865349aae47b90f9ef0b98f3fe3720c2f05601) Co-authored-by: Mark Dickinson <dickinsm@gmail.com>