summaryrefslogtreecommitdiffstats
path: root/Modules
Commit message (Collapse)AuthorAgeFilesLines
* [3.10] gh-99612: Fix PyUnicode_DecodeUTF8Stateful() for ASCII-only data ↵Miss Islington (bot)2023-08-221-1/+36
| | | | | | | | | | (GH-99613) (GH-107224) (#107230) Previously *consumed was not set in this case. (cherry picked from commit b8b3e6afc0a48c3cbb7c36d2f73e332edcd6058c) (cherry picked from commit f08e52ccb027f6f703302b8c1a82db9fd3934270) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.10] Revert "[3.10] gh-107077: Raise SSLCertVerificationError even if the ↵Pablo Galindo Salgado2023-08-031-4/+0
| | | | error is set via SSL_ERROR_SYSCALL (GH-107586) (#107589)" (#107602)
* [3.10] gh-107077: Raise SSLCertVerificationError even if the error is set ↵Miss Islington (bot)2023-08-031-0/+4
| | | | | | | via SSL_ERROR_SYSCALL (GH-107586) (#107589) Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com> Co-authored-by: T. Wouters <thomas@python.org>
* [3.10] gh-103142: Upgrade binary builds and CI to OpenSSL 1.1.1u (GH-105174) ↵Gregory P. Smith2023-06-052-2/+167
| | | | | | | | | | | | | | | | | | | | (GH-105200) (#105204) Upgrade builds to OpenSSL 1.1.1u. This OpenSSL version addresses a pile if less-urgent CVEs since 1.1.1t. The Mac/BuildScript/build-installer.py was already updated. 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). (cherry picked from commit a5d2b546c1b0b73d0695b98838a3ddd497382999) (cherry picked from commit f90d3f68db720bd6d0deda8cc0030339ccd43858) Co-authored-by: Gregory P. Smith <greg@krypto.org>
* [3.10] GH-95494: Fix transport EOF handling in OpenSSL 3.0 (GH-95495) (#103007)Miss Islington (bot)2023-03-271-4/+10
| | | | | | | | | | | | | | | | | | | | | | | GH-25309 enabled SSL_OP_IGNORE_UNEXPECTED_EOF by default, with a comment that it restores OpenSSL 1.1.1 behavior, but this wasn't quite right. That option causes OpenSSL to treat transport EOF as the same as close_notify (i.e. SSL_ERROR_ZERO_RETURN), whereas Python actually has distinct SSLEOFError and SSLZeroReturnError exceptions. (The latter is usually mapped to a zero return from read.) In OpenSSL 1.1.1, the ssl module would raise them for transport EOF and close_notify, respectively. In OpenSSL 3.0, both act like close_notify. Fix this by, instead, just detecting SSL_R_UNEXPECTED_EOF_WHILE_READING and mapping that to the other exception type. There doesn't seem to have been any unit test of this error, so fill in the missing one. This had to be done with the BIO path because it's actually slightly tricky to simulate a transport EOF with Python's fd based APIs. (If you instruct the server to close the socket, it gets confused, probably because the server's SSL object is still referencing the now dead fd?) (cherry picked from commit 420bbb783b43216cc897dc8914851899db37a31d) Co-authored-by: David Benjamin <davidben@google.com>
* [3.10] gh-102027: Fix macro name (GH-102124) (#102917)Miss Islington (bot)2023-03-241-1/+1
| | | | | | | | | | gh-102027: Fix macro name (GH-102124) This fixes the ssse3 / sse2 detection when sse4 is available. (cherry picked from commit ea93bde4ece139d4152a59f2c38aa6568559447c) Co-authored-by: Max Bachmann <kontakt@maxbachmann.de> Co-authored-by: Oleg Iarygin <oleg@arhadthedev.net>
* [3.10] gh-96931: Fix incorrect results in ssl.SSLSocket.shared_ciphers ↵Miss Islington (bot)2023-03-241-8/+28
| | | | | | | | (GH-96932) (#102919) gh-96931: Fix incorrect results in ssl.SSLSocket.shared_ciphers (GH-96932) (cherry picked from commit af9c34f6ef8dceb21871206eb3e4d350f6e3d3dc) Co-authored-by: Benjamin Fogle <benfogle@gmail.com>
* GH-100989: Revert Improve the accuracy of collections.deque docstrings ↵Miss Islington (bot)2023-03-241-24/+13
| | | | | | | (GH-102979) (cherry picked from commit 7f01a11199864bcf230b243b99e8a51e9044675d) Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
* gh-100989: Improve the accuracy of collections.deque docstrings (GH-100990)Miss Islington (bot)2023-03-221-13/+24
| | | | | | (cherry picked from commit c74073657e32b8872f91b3bbe1efa9af20adbea9) Co-authored-by: Timo Ludwig <ti.ludwig@web.de> Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
* [3.10] GH-102397: Fix segfault from race condition in signal handling ↵Miss Islington (bot)2023-03-081-0/+4
| | | | | | | | | (GH-102399) (#102527) GH-102397: Fix segfault from race condition in signal handling (GH-102399) (cherry picked from commit 1a84cc007e207f2dd61f86a7fc3d86632fdce72f) Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com> Co-authored-by: Gregory P. Smith <greg@krypto.org>
* [3.10] gh-102179: Fix `os.dup2` error reporting for negative fds (GH-102180) ↵Miss Islington (bot)2023-03-041-5/+0
| | | | | | | | | (#102419) * gh-102179: Fix `os.dup2` error reporting for negative fds (GH-102180) (cherry picked from commit c2bd55d26f8eb2850eb9f9026b5d7f0ed1420b65) Co-authored-by: Alexey Izbyshev <izbyshev@ispras.ru> Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
* [3.10] Add missing 'is' to `cmath.log()` docstring (GH-102049) (#102280)Mark Dickinson2023-02-262-4/+4
| | | | | | Fix missing 'is' in cmath.log() docstring. (cherry picked from commit 71f614ef2a3d66213b9cae807cbbc1ed03741221) Co-authored-by: Owain Davies <116417456+OTheDev@users.noreply.github.com>
* gh-101372: Fix unicodedata.is_normalized to properly handle the UCD 3… ↵Miss Islington (bot)2023-02-061-1/+1
| | | | | | | (gh-101388) (cherry picked from commit 9ef7e75434587fc8f167d73eee5dd9bdca62714b) Co-authored-by: Dong-hee Na <donghee.na@python.org>
* [3.10] [3.11] gh-99952: fix refcount issues in ctypes.Structure from_param() ↵Miss Islington (bot)2023-02-042-0/+9
| | | | | | | | | | | | | | | | result (GH-101339) (#101340) [3.11] gh-99952: [ctypes] fix refcount issues in from_param() result. (GH-100169) Fixes a reference counting issue with `ctypes.Structure` when a `from_param()` method call is used and the structure size is larger than a C pointer `sizeof(void*)`. This problem existed for a very long time, but became more apparent in 3.8+ by change likely due to garbage collection cleanup timing changes.. (cherry picked from commit dfad678d7024ab86d265d84ed45999e031a03691) (cherry picked from commit fa7c37af4936abfe34aa261d6ed9703bc5842ad4) Co-authored-by: Gregory P. Smith <greg@krypto.org> Co-authored-by: Yukihiro Nakadaira <yukihiro.nakadaira@gmail.com> Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
* gh-100795: Don't call freeaddrinfo on failure. (GH-101252)Miss Islington (bot)2023-01-231-0/+4
| | | | | | | | | | | | When getaddrinfo returns an error, the output pointer is in an unknown state Don't call freeaddrinfo on it. See the issue for discussion and details with links to reasoning. _Most_ libc getaddrinfo implementations never modify the output pointer unless they are returning success. (cherry picked from commit b724ac2fe7fbb5a7a33d639cad8e748f17b325e0) Co-authored-by: Gregory P. Smith <greg@krypto.org> Co-authored-by: Sergey G. Brester <github@sebres.de> Co-authored-by: Oleg Iarygin <dralife@yandex.ru>
* gh-82052: Don't send partial UTF-8 sequences to the Windows API (GH-101103)Miss Islington (bot)2023-01-171-1/+16
| | | | | | Don't send partial UTF-8 sequences to the Windows API (cherry picked from commit f34176b77f222726d901595968a4b44456186da4) Co-authored-by: Paul Moore <p.f.moore@gmail.com>
* [3.10] GH-100892: Fix race in clearing `threading.local` (GH-100922). (#100938)Kumar Aditya2023-01-112-15/+56
| | | | | (cherry picked from commit 762745a124cbc297cf2fe6f3ec9ca1840bb2e873) Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
* GH-81061: Fix refcount issue when returning `None` from a `ctypes.py_object` ↵Miss Islington (bot)2023-01-091-8/+7
| | | | | | | callback (GH-13364) (cherry picked from commit 837ba052672d1a5f85a46c1b6d4b6e7d192af6f3) Co-authored-by: dgelessus <dgelessus@users.noreply.github.com>
* [3.10] gh-100689: Revert "bpo-41798: pyexpat: Allocate the expat_CAPI on the ↵Miss Islington (bot)2023-01-081-40/+27
| | | | | | | | | | | | | | heap memory (GH-24061)" (GH-100745) (#100847) gh-100689: Revert "bpo-41798: pyexpat: Allocate the expat_CAPI on the heap memory (GH-24061)" (GH-100745) * gh-100689: Revert "bpo-41798: pyexpat: Allocate the expat_CAPI on the heap memory (GH-24061)" This reverts commit 7c83eaa536d2f436ae46211ca48692f576c732f0. (cherry picked from commit b034fd3e5926c63a681a211087b4c666834c7525) Co-authored-by: Nikita Sobolev <mail@sobolevn.me> Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
* [3.10] gh-76963: PEP3118 itemsize of an empty ctypes array should not be 0 ↵Miss Islington (bot)2022-12-231-8/+25
| | | | | | | | | | (GH-5576) (#100451) gh-76963: PEP3118 itemsize of an empty ctypes array should not be 0 (GH-5576) The itemsize returned in a memoryview of a ctypes array is now computed from the item type, instead of dividing the total size by the length and assuming that the length is not zero. (cherry picked from commit 84bc6a4f25fcf467813ee12b74118f7b1b54e285) Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
* [3.10] gh-99240: Reset pointer to NULL when the pointed memory is freed in ↵colorfulappl2022-12-211-0/+20
| | | | | | | | argument parsing (GH-99890) (#100386) (cherry picked from commit efbb1eb9f54cad4f7bf5df03eed3a6aba02d99f4) Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com> Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
* [3.10] gh-99240: Fix double-free bug in Argument Clinic str_converter ↵colorfulappl2022-12-202-1/+150
| | | | | | | generated code (GH-99241) (#100353) (cherry picked from commit 8dbe08eb7c807f484fe9870f5b7f5ae2881fd966) Fix double-free bug mentioned at GH-99240, by moving memory clean up out of "exit" label.
* [3.10] gh-96002: Add functional test for Argument Clinic (GH-96178) (#100232)colorfulappl2022-12-172-0/+2869
| | | | | | (cherry picked from commit c450c8c9ed6e420025f39d0e4850a79f8160cdcd) Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com> Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
* [3.10] gh-93453: Only emit deprecation warning in asyncio.get_event_loop ↵Łukasz Langa2022-12-061-7/+5
| | | | | | | | | | | when a new event loop is created (#100059) It no longer emits a deprecation warning if the current event loop was set. (cherry picked from commit 3fae04b10e2655a20a3aadb5e0d63e87206d0c67) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com> Co-authored-by: Łukasz Langa <lukasz@langa.pl>
* [3.10] gh-60203: Revert changes in cycle.__setstate__ (GH-99982) (#100017)Łukasz Langa2022-12-051-0/+1
| | | | | | | In case if only True/False be supported as boolean arguments in future, we should continue to support 1/0 here. (cherry picked from commit 922a6cf6c265e2763a003291885ff74d46203fc3) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* bpo-40882: Fix a memory leak in SharedMemory on Windows (GH-20684)Luke Garland2022-12-022-1/+52
| | | | | | | | In multiprocessing.shared_memory.SharedMemory(), the temporary view returned by MapViewOfFile() should be unmapped when it is no longer needed. (cherry picked from commit 85c128e34daec7625b74746e127afa25888ccde1) Co-authored-by: Zackery Spytz <zspytz@gmail.com>
* [3.10] bpo-31718: Fix io.IncrementalNewlineDecoder SystemErrors and s… ↵Kumar Aditya2022-11-281-13/+21
| | | | | | | | | | | | (#99842) [3.10] bpo-31718: Fix io.IncrementalNewlineDecoder SystemErrors and segfaults (GH-18640) Co-authored-by: Oren Milman <orenmn@gmail.com> Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>. (cherry picked from commit 53eef27133c1da395b3b4d7ce0ab1d5b743ffb41) Co-authored-by: Zackery Spytz <zspytz@gmail.com>
* GH-95896: posixmodule.c: fix osdefs.h inclusion to not depend on compiler ↵Miss Islington (bot)2022-11-261-11/+3
| | | | | | | | (GH-95897) (cherry picked from commit ec2b76aa8b7c6313293ff9c6814e8bc31e08fcaf) Co-authored-by: TheShermanTanker <32636402+TheShermanTanker@users.noreply.github.com> Co-authored-by: Steve Dower <steve.dower@python.org>
* bpo-38031: Fix a possible assertion failure in _io.FileIO() (GH-GH-5688)Miss Islington (bot)2022-11-251-1/+5
| | | | | (cherry picked from commit d386115039e75c332c8471c239cf7dc5dee791a7) Co-authored-by: Zackery Spytz <zspytz@gmail.com>
* [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>