| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
| |
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-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-122900)
|
|
|
| |
Make `_asyncio.all_tasks` thread safe, also changes state lock to use critical section.
|
|
|
| |
Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
|
| |
|
|
|
|
|
|
|
|
|
| |
(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.
|
|
|
|
| |
As now building Python now requires support of IEEE 754 floating point
numbers.
|
|
|
| |
(LIBPYTHON was renamed MODULE_LDFLAGS in commit 7f5e3f04f.)
|
|
|
|
| |
* Add Lib/test/test_capi/test_eval.py
* Add Modules/_testlimitedcapi/eval.c
|
|
|
|
|
|
|
|
|
| |
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-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.
|
|
|
|
| |
implementation (GH-122047)
|
|
|
|
|
|
|
| |
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().
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
(#122317)
* gh-120974: Make asyncio `swap_current_task` safe in free-threaded build
|
|
|
| |
Replace PyMem_Del() with PyMem_Free().
|
|
|
|
| |
PyObject_Del() is just a alias to PyObject_Free() kept for backward
compatibility. Use directly PyObject_Free() instead.
|
|
|
|
|
| |
Don't expose `FICLONE` ioctl on Android
Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
| |
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
Update `_PyDict_DelItemIf` to allow for an argument to be passed to the
predicate.
|
|
|
| |
This allows to identify the source of the error.
|
|
|
|
|
| |
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.
|
|
|
|
| |
Use `PyDict_SetDefaultRef` to set the current task in a single operation
under the dictionary's lock.
|
|
|
|
| |
Relatedly, emit the `cpython.run_startup` event from the Python version of
`PYTHONSTARTUP` handling.
|
|
|
|
| |
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).
|
|
|
|
|
|
| |
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-121907)
|
| |
|
|
|
|
| |
use-after-free (#120297)
|
|
|
|
| |
This avoids changing the ABI and keeps the field in the private struct.
|
| |
|
|
|
| |
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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-121805)
See 6b98b274b6 for an explanation of the problem and solution. Here I've applied the solution to channels.
|