summaryrefslogtreecommitdiffstats
path: root/Modules
Commit message (Collapse)AuthorAgeFilesLines
* [3.11] gh-104399: Use newer libtommath APIs when necessary (GH-104407) (#105344)Miss Islington (bot)2023-06-061-2/+21
| | | | | | gh-104399: Use newer libtommath APIs when necessary (GH-104407) (cherry picked from commit 00d73caf804c0474980e471347d6385757af975f) Co-authored-by: Christopher Chavez <chrischavez@gmx.us>
* [3.11] gh-103142: Upgrade binary builds and CI to OpenSSL 1.1.1u (GH-105174) ↵Gregory P. Smith2023-06-012-2/+167
| | | | | | | | | | | | | | | (#105200) 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)
* [3.11] gh-104372: Cleanup _posixsubprocess make_inheritable for async signal ↵Gregory P. Smith2023-05-241-34/+91
| | | | | | | | | | | | | | | | safety gh-104518 (#104785) Move all of the Python C API calls into the parent process up front instead of doing PyLong_AsLong and PyErr_Occurred and PyTuple_GET from the post-fork/vfork child process. Much of this was long overdue. We shouldn't have been using PyTuple and PyLong APIs within all of these low level functions anyways. This is a backport of c649df6 for #104518 and the tiny adjustment in d1732fe #104697. Backporting this allows backporting of the real bug fix that requires it. Co-authored-by: Gregory P. Smith [Google] <greg@krypto.org>
* [3.11] Add IPv6 into to the docstring for socket.getsockname (GH-102961) ↵Miss Islington (bot)2023-05-221-1/+2
| | | | | | | | | (#103137) Add IPv6 into to the docstring for socket.getsockname (GH-102961) (cherry picked from commit ecc5441505cd7cb54f3d38409c732e2e9f102137) Signed-off-by: Brian Haley <haleyb.dev@gmail.com> Co-authored-by: Brian Haley <brianphaley@gmail.com>
* [3.11] gh-104698: Fix reference leak in mmapmodule.c (GH-104700) (#104710)Miss Islington (bot)2023-05-211-3/+19
| | | | | | (cherry picked from commit 99b641886a09252bbcf99a1d322fa8734f1ca30d) Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru> Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
* [3.11] gh-101857: Allow xattr detection on musl libc (GH-101858) (#101894)Miss Islington (bot)2023-05-211-1/+2
| | | | | | | | | | | | | | | gh-101857: Allow xattr detection on musl libc (GH-101858) Previously, we checked exclusively for `__GLIBC__` (AND'd with some other conditions). Checking for `__linux__` instead should be fine. This fixes using e.g. `os.listxattr()` on systems using musl libc. Bug: https://bugs.gentoo.org/894130 (cherry picked from commit 8be8101bca34b60481ec3d7ecaea4a3379fb7dbb) Co-authored-by: Sam James <sam@gentoo.org> Co-authored-by: Gregory P. Smith <greg@krypto.org>
* [3.11] gh-103987: fix several crashes in mmap module (GH-103990) (#104677)Miss Islington (bot)2023-05-201-2/+13
| | | | | | | | gh-103987: fix several crashes in mmap module (GH-103990) (cherry picked from commit ceaa4c3476ac49b5b31954fec53796c7a3b40349) Co-authored-by: Prince Roshan <princekrroshan01@gmail.com> Co-authored-by: sunmy2019 <59365878+sunmy2019@users.noreply.github.com> Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
* [3.11] GH-102818: Do not call PyTraceBack_Here in sys.settrace trampoline ↵Mark Shannon2023-05-191-0/+28
| | | | | (GH-104650) Backport of GH-104579
* [3.11] gh-104645: fix error handling in marshal tests (GH-104646) (#104663)Miss Islington (bot)2023-05-191-18/+14
| | | | | | gh-104645: fix error handling in marshal tests (GH-104646) (cherry picked from commit ac56a854b418d35ad3838f3072604227dc718fca) Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
* [3.11] GH-104308: socket.getnameinfo should release the GIL (GH-104307) ↵Miss Islington (bot)2023-05-081-0/+2
| | | | | | | | | | | | | | | | (#104313) GH-104308: socket.getnameinfo should release the GIL (GH-104307) * socket.getnameinfo should release the GIL * 📜🤖 Added by blurb_it. --------- (cherry picked from commit faf196213e60d8a90773e9e5680d3252bd294643) Co-authored-by: Nathaniel J. Smith <njs@pobox.com> Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
* [3.11] gh-104265 Disallow instantiation of `_csv.Reader` and `_csv.Writer` ↵Miss Islington (bot)2023-05-081-2/+2
| | | | | | | | (GH-104266) (#104278) gh-104265 Disallow instantiation of `_csv.Reader` and `_csv.Writer` (GH-104266) (cherry picked from commit 06c2a4858b8806abc700a0471434067910db54ec) Co-authored-by: chgnrdv <52372310+chgnrdv@users.noreply.github.com>
* [3.11] gh-100370: fix OverflowError in sqlite3.Connection.blobopen for ↵Erlend E. Aasland2023-05-082-9/+26
| | | | 32-bit builds (#103902) (#104285)
* [3.11] gh-104106: Add gcc fallback of mkfifoat/mknodat for macOS (gh-104129) ↵Dong-hee Na2023-05-051-0/+8
| | | | | (gh-104187) gh-104106: Add gcc fallback of mkfifoat/mknodat for macOS (gh-104129)
* gh-103242: Migrate SSLContext.set_ecdh_curve not to use deprecated APIs ↵Miss Islington (bot)2023-04-081-3/+8
| | | | | | | | (GH-103378) Migrate `SSLContext.set_ecdh_curve()` not to use deprecated OpenSSL APIs. (cherry picked from commit 35167043e3a21055a94cf3de6ceccd1585554cb8) Co-authored-by: Dong-hee Na <donghee.na@python.org>
* gh-103256: Fix hmac algorithm to support fallback implementation (gh-103286)Miss Islington (bot)2023-04-071-1/+1
| | | | | | (cherry picked from commit efb0a2cf3adf4629cf4669cb558758fb78107319) Co-authored-by: Dong-hee Na <donghee.na@python.org> Co-authored-by: Gregory P. Smith <greg@krypto.org>
* [3.11] GH-95494: Fix transport EOF handling in OpenSSL 3.0 (GH-95495) (#103006)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.11] gh-102281: Fix potential nullptr dereference + use of uninitia… ↵Max Bachmann2023-03-251-1/+4
| | | | | | (#103040) [3.11] gh-102281: Fix potential nullptr dereference + use of uninitialized memory (gh-102282) (cherry picked from commit afa6092ee4260bacf7bc11905466e4c3f8556cbb)
* [3.11] gh-102027: Fix macro name (GH-102124) (#102916)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.11] gh-96931: Fix incorrect results in ssl.SSLSocket.shared_ciphers ↵Miss Islington (bot)2023-03-241-8/+28
| | | | | | | | (GH-96932) (#102918) 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: remove annotation from docstring (GH-102991)Miss Islington (bot)2023-03-241-2/+2
| | | | | (cherry picked from commit d49409196e0c73c38e3f96cf860cbffda40607ec) Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.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.11] gh-102493: backport unit test for PyErr_SetObject (#102602)Irit Katriel2023-03-111-0/+15
| | | gh-102493: backport unit test for PyErr_SetObject
* GH-102397: Fix segfault from race condition in signal handling (GH-102399)Miss Islington (bot)2023-03-081-0/+4
| | | | | | (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>
* gh-102179: Fix `os.dup2` error reporting for negative fds (GH-102180)Miss Islington (bot)2023-03-041-5/+0
| | | | | (cherry picked from commit c2bd55d26f8eb2850eb9f9026b5d7f0ed1420b65) Co-authored-by: Alexey Izbyshev <izbyshev@ispras.ru>
* [3.11] Add missing 'is' to `cmath.log()` docstring (GH-102049) (#102279)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>
* [3.11] gh-101656: Fix "conversion from Py_ssize_t to int" warning in ↵Nikita Sobolev2023-02-081-3/+3
| | | | | `_testcapimodule` (#101680) (cherry picked from commit acc2f3b19d28d4bf3f8fb32357f581cba5ba24c7)
* [3.11] gh-101072: support default and kw default in PyEval_EvalCodeEx for ↵Łukasz Langa2023-02-071-0/+139
| | | | | | 3.11+ (GH-101127) (#101636) Co-authored-by: Łukasz Langa <lukasz@langa.pl> Co-authored-by: Matthieu Dartiailh <m.dartiailh@gmail.com>
* gh-101543: Ensure Windows registry path is only used when stdlib can't be ↵Miss Islington (bot)2023-02-061-19/+12
| | | | | | | found (GH-101544) (cherry picked from commit 7a253103d4c64fcca4c0939a584c2028d8da6829) Co-authored-by: Steve Dower <steve.dower@python.org>
* 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.11] gh-99952: fix refcount issues in ctypes.Structure from_param() result ↵Gregory P. Smith2023-01-262-0/+9
| | | | | | | | | | | | (#101339) [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) Co-authored-by: Yukihiro Nakadaira <yukihiro.nakadaira@gmail.com>
* [3.11] gh-101326: Fix regression when passing None to FutureIter.throw ↵Shantanu2023-01-251-1/+6
| | | | | | | (GH-101327) (#101328) (cherry picked from commit a178ba82bfe2f2fb6f6ff0e67cb734fd7c4321e3) Co-authored-by: Shantanu <12621235+hauntsaninja@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>
* gh-100320: Fix path calculations on Windows when python.exe is moved outside ↵Steve Dower2023-01-161-18/+30
| | | | of the normal location (GH-100947)
* [3.11] GH-100892: Fix race in clearing `threading.local` (GH-100922). (#100937)Kumar Aditya2023-01-112-19/+59
| | | | | (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>
* gh-100689: Revert "bpo-41798: pyexpat: Allocate the expat_CAPI on the heap ↵Miss Islington (bot)2023-01-081-40/+27
| | | | | | | | | | 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>
* gh-100649: Update native_thread_id after fork (gh-100650)Miss Islington (bot)2023-01-011-0/+4
| | | | | | Update native_thread_id after fork (cherry picked from commit d52d4942cfdd52a50f88b87b1ff2a67375dbcf47) Co-authored-by: Gabriele N. Tornetta <P403n1x87@users.noreply.github.com>
* [3.11] GH-100342: check for allocation failure in AC `*args` parsing ↵Kumar Aditya2022-12-281-1/+7
| | | | | | | (GH-100343). (#100568) (cherry picked from commit 7cf164ad5e3c8c6af5ae8813ad6a784448605418) Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
* [3.11] gh-64490: Fix bugs in argument clinic varargs processing (GH-32092) ↵colorfulappl2022-12-282-1/+370
| | | | | (#100368) (cherry picked from commit 0da728387c99fe6c127b070f2d250dc5bdd62ee5)
* [3.11] gh-99110: Initialize frame->previous in init_frame to fix ↵Bill Fisher2022-12-241-0/+18
| | | | | | | segmentation fault (GH-100182) (#100478) (cherry picked from commit 88d565f32a709140664444c6dea20ecd35a10e94) Co-authored-by: Bill Fisher <william.w.fisher@gmail.com>
* [3.11] gh-76963: PEP3118 itemsize of an empty ctypes array should not be 0 ↵Miss Islington (bot)2022-12-231-8/+25
| | | | | | | | | | | (GH-5576) (GH-100452) 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>
* gh-78878: Fix crash when creating an instance of `_ctypes.CField` (GH-14837)Miss Islington (bot)2022-12-212-10/+3
| | | | | (cherry picked from commit d713c54ac8a2eba0616a5a07714696d935f1062e) Co-authored-by: Hai Shi <shihai1992@gmail.com>
* [3.11] gh-99240: Reset pointer to NULL when the pointed memory is freed in ↵colorfulappl2022-12-211-0/+20
| | | | | | | | argument parsing (GH-99890) (#100385) (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.11] gh-99240: Fix double-free bug in Argument Clinic str_converter ↵colorfulappl2022-12-202-1/+150
| | | | | | | generated code (GH-99241) (#100352) (cherry picked from commit 8dbe08eb7c807f484fe9870f5b7f5ae2881fd966) Fix double-free bug mentioned at GH-99240, by moving memory clean up out of "exit" label.
* [3.11] gh-64490: Fix refcount error when arguments are packed to tuple in ↵colorfulappl2022-12-192-1/+103
| | | | | argument clinic (GH-99233) (#100338) (cherry picked from commit 69f6cc77d0f1664f983a83b6ae707d99a99f5c4f)
* [3.11] gh-96002: Add functional test for Argument Clinic (GH-96178) (#100230)colorfulappl2022-12-173-0/+2870
| | | | | | (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.11] gh-93453: Only emit deprecation warning in asyncio.get_event_loop ↵Serhiy Storchaka2022-12-061-7/+5
| | | | | | | when a new event loop is created (#99949) It no longer emits a deprecation warning if the current event loop was set. Co-authored-by: Łukasz Langa <lukasz@langa.pl>
* [3.11] gh-60203: Revert changes in cycle.__setstate__ (GH-99982) (#100016)Ł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>