summaryrefslogtreecommitdiffstats
path: root/Modules
Commit message (Collapse)AuthorAgeFilesLines
* gh-122681: remove m_atan2()/c_atan2() helpers (#122715)Sergey B Kirpichev2024-08-173-42/+3
|
* gh-99108: Add HACL* Blake2 implementation to hashlib (GH-119316)Jonathan Protzenko2024-08-1345-4785/+11141
| | | | | | | This replaces the existing hashlib Blake2 module with a single implementation that uses HACL\*'s Blake2b/Blake2s implementations. We added support for all the modes exposed by the Python API, including tree hashing, leaf nodes, and so on. We ported and merged all of these changes upstream in HACL\*, added test vectors based on Python's existing implementation, and exposed everything needed for hashlib. This was joint work done with @R1kM. See the PR for much discussion and benchmarking details. TL;DR: On many systems, 8-50% faster (!) than `libb2`, on some systems it appeared 10-20% slower than `libb2`.
* gh-117482: Make the Slot Wrapper Inheritance Tests Much More Thorough ↵Eric Snow2024-08-121-0/+16
| | | | | | | | | | (gh-122867) There were a still a number of gaps in the tests, including not looking at all the builtin types and not checking wrappers in subinterpreters that weren't in the main interpreter. This fixes all that. I considered incorporating the names of the PyTypeObject fields (a la gh-122866), but figured doing so doesn't add much value.
* gh-122688: Add more tests for var-positional parameters in Argument Clinic ↵Serhiy Storchaka2024-08-122-88/+329
| | | | (GH-122900)
* GH-120974: make `_asyncio.all_tasks` thread safe (#122801)Kumar Aditya2024-08-111-7/+15
| | | Make `_asyncio.all_tasks` thread safe, also changes state lock to use critical section.
* gh-115808: Add ``is_none`` and ``is_not_none`` to ``operator`` (#115814)Nico Mexis2024-08-102-1/+49
| | | Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
* gh-111495: Fix refleaks in test_capi.test_eval tests (#122851)Victor Stinner2024-08-091-3/+3
|
* gh-122688: Fix support of var-positional parameter in Argument Clinic ↵Serhiy Storchaka2024-08-092-57/+94
| | | | | | | | | (GH-122689) * Parameters after the var-positional parameter are now keyword-only instead of positional-or-keyword. * Correctly calculate min_kw_only. * Raise errors for invalid combinations of the var-positional parameter with "*", "/" and deprecation markers.
* gh-121268: Remove workarounds for non-IEEE 754 systems in cmath (#122716)Sergey B Kirpichev2024-08-091-14/+3
| | | | As now building Python now requires support of IEEE 754 floating point numbers.
* gh-116622: Rename build variable MODULE_LDFLAGS back to LIBPYTHON (#122764)Malcolm Smith2024-08-081-1/+1
| | | (LIBPYTHON was renamed MODULE_LDFLAGS in commit 7f5e3f04f.)
* gh-111495: Add more tests on PyEval C APIs (#122789)Victor Stinner2024-08-085-22/+100
| | | | * Add Lib/test/test_capi/test_eval.py * Add Modules/_testlimitedcapi/eval.c
* gh-105201: Add PyIter_NextItem() (#122331)Erlend E. Aasland2024-08-071-0/+29
| | | | | | | | | Return -1 and set an exception on error; return 0 if the iterator is exhausted, and return 1 if the next item was fetched successfully. Prefer this API to PyIter_Next(), which requires the caller to use PyErr_Occurred() to differentiate between iterator exhaustion and errors. Co-authered-by: Irit Katriel <iritkatriel@yahoo.com>
* gh-118814: Fix the TypeVar constructor when name is passed by keyword ↵Serhiy Storchaka2024-08-072-1/+93
| | | | | | | | (GH-122664) Fix _PyArg_UnpackKeywordsWithVararg for the case when argument for positional-or-keyword parameter is passed by keyword. There was only one such case in the stdlib -- the TypeVar constructor.
* gh-100256: Skip inaccessible registry keys in the WinAPI mimetype ↵Lucas Esposito2024-08-071-1/+1
| | | | implementation (GH-122047)
* gh-122728: Fix SystemError in PyEval_GetLocals() (#122735)Victor Stinner2024-08-061-0/+7
| | | | | | | Fix PyEval_GetLocals() to avoid SystemError ("bad argument to internal function"). Don't redefine the 'ret' variable in the if block. Add an unit test on PyEval_GetLocals().
* gh-122681: merge m_atan2() and c_atan2() helper functions (#122682)Sergey B Kirpichev2024-08-063-69/+41
|
* gh-122704: Fix reference leak in Modules/_pickle.c (GH-122705)Kirill Podoprigora2024-08-061-0/+4
|
* gh-122459: Optimize pickling by name objects without __module__ (GH-122460)Serhiy Storchaka2024-08-051-127/+122
|
* gh-122637: fix tanh(±0+infj) and tanh(±0+nanj) to return ±0+nanj (#122638)Sergey B Kirpichev2024-08-041-2/+2
| | | | | | | | | As per C11 DR#471, ctanh (0 + i NaN) and ctanh (0 + i Inf) should return 0 + i NaN (with "invalid" exception in the second case). This has corresponding implications for ctan(z), as its errors and special cases are handled as if the operation is implemented by -i*ctanh(i*z). This patch fixes cmath's code to do same. Glibs patch: https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=d15e83c5f5231d971472b5ffc9219d54056ca0f1
* gh-121889: cmath.acosh(0+nanj) returns nan+pi/2j (#121892)Sergey B Kirpichev2024-08-041-2/+2
| | | | | As per C11 DR#471 (adjusted resolution accepted for C17), cacosh (0 + iNaN) should return NaN ± i pi/2, not NaN + iNaN. This patch fixes cmath's code to do same.
* gh-120974: Make asyncio `swap_current_task` safe in free-threaded build ↵Sam Gross2024-08-021-14/+23
| | | | | (#122317) * gh-120974: Make asyncio `swap_current_task` safe in free-threaded build
* Update PyObject_Del() documentation (#122597)Victor Stinner2024-08-022-9/+9
| | | Replace PyMem_Del() with PyMem_Free().
* Replace PyObject_Del with PyObject_Free (#122453)Victor Stinner2024-08-012-4/+4
| | | | PyObject_Del() is just a alias to PyObject_Free() kept for backward compatibility. Use directly PyObject_Free() instead.
* gh-116622: Don't expose `FICLONE` ioctl on Android (#122522)Malcolm Smith2024-08-011-0/+5
| | | | | Don't expose `FICLONE` ioctl on Android Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
* gh-121381 Remove subprocess._USE_VFORK escape hatch (#121383)Cody Maloney2024-07-312-14/+8
| | | | | | | | | | | This flag was added as an escape hatch in gh-91401 and backported to Python 3.10. The flag broke at some point between its addition and now. As there is currently no publicly known environments that require this, remove it rather than work on fixing it. This leaves the flag in the subprocess module to not break code which may have used / checked the flag itself. discussion: https://discuss.python.org/t/subprocess-use-vfork-escape-hatch-broken-fix-or-remove/56915/2
* gh-122311: Fix a refleak in pickle (GH-122411)Serhiy Storchaka2024-07-291-0/+1
|
* gh-122311: Fix some error messages in pickle (GH-122386)Serhiy Storchaka2024-07-291-3/+3
|
* gh-122332: Fix missing `NULL` check in `asyncio.Task.get_coro` (#122338)Peter Bierma2024-07-271-1/+5
|
* gh-121489: Export private _PyBytes_Join() again (#122267)Marc Mueller2024-07-251-1/+0
|
* gh-82951: Fix serializing by name in pickle protocols < 4 (GH-122149)Serhiy Storchaka2024-07-251-17/+36
| | | | | | Serializing objects with complex __qualname__ (such as unbound methods and nested classes) by name no longer involves serializing parent objects by value in pickle protocols < 4.
* gh-113785: csv: fields starting with escapechar are not quoted (GH-122110)Mikołaj Kuranowski2024-07-251-1/+0
|
* GH-121832: Assert that the version number of static builtin types is not ↵Mark Shannon2024-07-241-46/+42
| | | | | changed by PyType_Modified. (GH-122182) Update datetime module and test_type_cache.py to not call PyType_Modified.
* gh-120974: Make _asyncio._leave_task atomic in the free-threaded build (#122139)Sam Gross2024-07-232-28/+27
| | | | | | | * gh-120974: Make _asyncio._leave_task atomic in the free-threaded build Update `_PyDict_DelItemIf` to allow for an argument to be passed to the predicate.
* gh-122163: Add notes for JSON serialization errors (GH-122165)Serhiy Storchaka2024-07-231-4/+9
| | | This allows to identify the source of the error.
* gh-120974: Use common freelist code in asyncio (#122132)Sam Gross2024-07-231-69/+4
| | | | | This refactors asyncio to use the common freelist helper functions and macros. As a side effect, the freelist for _asyncio.Future is now re-enabled in the free-threaded build.
* gh-120974: Make _asyncio._enter_task atomic in the free-threaded build (#122138)Sam Gross2024-07-231-10/+5
| | | | Use `PyDict_SetDefaultRef` to set the current task in a single operation under the dictionary's lock.
* gh-121957: Emit audit events for `python -i` and `python -m asyncio` (GH-121958)Łukasz Langa2024-07-221-0/+4
| | | | Relatedly, emit the `cpython.run_startup` event from the Python version of `PYTHONSTARTUP` handling.
* gh-121621: Disable asyncio freelist in free-threaded build (#122046)Sam Gross2024-07-191-5/+17
| | | | The futureobj freelist isn't thread-safe. We intend to re-enable the freelist in a thread-safe way for 3.14 (but not 3.13).
* gh-120973: Fix thread-safety issues with `threading.local` (#121655)mpage2024-07-191-150/+234
| | | | | | This is a small refactoring to the current design that allows us to avoid manually iterating over threads. This should also fix gh-118490.
* gh-118830: Bump pickle.DEFAULT_PROTOCOL to 5 (GH-119340)Rodrigo Oliveira2024-07-192-11/+11
|
* gh-121905: Consistently use "floating-point" instead of "floating point" ↵Serhiy Storchaka2024-07-1914-37/+37
| | | | (GH-121907)
* gh-120289: Add external timer in traverse of _lsprof.Profiler (#121998)Tian Gao2024-07-191-0/+1
|
* gh-120289: Disallow disable() and clear() in external timer to prevent ↵Tian Gao2024-07-181-1/+19
| | | | use-after-free (#120297)
* gh-121621: Move asyncio_running_loop to private struct (#121939)Sam Gross2024-07-171-4/+4
| | | | This avoids changing the ABI and keeps the field in the private struct.
* gh-121925: Fix uninitialized variables in `main.c` (#121926)sobolevn2024-07-171-2/+6
|
* gh-120678: pyrepl: Include globals from modules passed with `-i` (GH-120904)Alex Waygood2024-07-171-1/+49
| | | Co-authored-by: Łukasz Langa <lukasz@langa.pl>
* gh-121621: Move asyncio running loop to thread state (GH-121695)Ken Jin2024-07-161-104/+12
|
* gh-113993: Don't immortalize in PyUnicode_InternInPlace; keep immortalizing ↵Petr Viktorin2024-07-161-3/+8
| | | | | | | | | | | | | | | | | in other API (#121364) * Switch PyUnicode_InternInPlace to _PyUnicode_InternMortal, clarify docs * Document immortality in some functions that take `const char *` This is PyUnicode_InternFromString; PyDict_SetItemString, PyObject_SetAttrString; PyObject_DelAttrString; PyUnicode_InternFromString; and the PyModule_Add convenience functions. Always point out a non-immortalizing alternative. * Don't immortalize user-provided attr names in _ctypes
* gh-121791: Check for `NULL` in `MethodDescriptor2_new` in `_testcapi` (#121792)sobolevn2024-07-161-0/+3
|
* gh-76785: Expand How Interpreter Channels Handle Interpreter Finalization ↵Eric Snow2024-07-153-110/+321
| | | | | (gh-121805) See 6b98b274b6 for an explanation of the problem and solution. Here I've applied the solution to channels.