summaryrefslogtreecommitdiffstats
path: root/Modules
Commit message (Collapse)AuthorAgeFilesLines
...
* gh-116741: Upgrade libexpat to 2.6.2 (#117296)Seth Michael Larson2024-04-233-16/+36
| | | Upgrade libexpat to 2.6.2
* gh-117995: Don't raise DeprecationWarnings for indexed nameless params (#118001)Erlend E. Aasland2024-04-221-1/+1
| | | | | Filter out '?NNN' placeholders when looking for named params. Co-authored-by: AN Long <aisk@users.noreply.github.com>
* GH-115874: Fix segfault in FutureIter_dealloc (GH-117741)Savannah Ostrowski2024-04-191-2/+16
|
* gh-114099: Modify preprocessor symbol usage to support older macOS SDKs ↵Russell Keith-Magee2024-04-191-0/+4
| | | | | (GH-118073) Co-authored-by: Joshua Root jmr@macports.org
* gh-88035: update doc-string of `epoch` in timemodule.c (GH-118076)lit2024-04-191-2/+2
| | | | | | Follow #88035, update doc-string of epoch in timemodule.c The epoch is `January 1st, 1970 on all platforms`, according to current documentation.
* gh-112069: Add _PySet_NextEntryRef to be thread-safe. (gh-117990)Donghee Na2024-04-183-17/+28
|
* gh-117968: Add tests for the part of the PyRun family of the C API (GH-117982)Serhiy Storchaka2024-04-174-1/+127
| | | | Co-authored-by: NGRsoftlab <78017794+NGRsoftlab@users.noreply.github.com> Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
* gh-117680: make _PyInstructionSequence a PyObject and use it in tests (#117629)Irit Katriel2024-04-172-1/+34
|
* GH-100242: bring functools.py partial implementation more in line with C ↵CF Bolz-Tereick2024-04-171-4/+11
| | | | | | | code (GH-100244) in partial.__new__, before checking for the existence of the attribute 'func', first check whether the argument is an instance of partial.
* gh-117845: Detect libedit hook function signature in configure (#117870)Joshua Root2024-04-171-2/+2
| | | | | | Older libedit versions (like Apple's) use a different type signature for rl_startup_hook and rl_pre_input_hook. Add a configure check to determine which signature is accepted by introducing the Py_RL_STARTUP_HOOK_TAKES_ARGS macro in pyconfig.h.
* gh-117613: Argument Clinic: ensure that 'defining_class' params are ↵neonene2024-04-162-6/+6
| | | | positional-only (#117781)
* gh-117613: Enhance test_clinic @defining_class tests (#117896)Victor Stinner2024-04-162-17/+88
|
* gh-90329: Add _winapi.GetLongPathName and GetShortPathName and use in venv ↵Steve Dower2024-04-152-1/+228
| | | | to reduce warnings (GH-117817)
* gh-117694: Improve tests for PyEval_EvalCodeEx() (GH-117695)Serhiy Storchaka2024-04-151-80/+33
|
* gh-117764: Use Argument Clinic for signal.set_wakeup_fd() (GH-117777)Serhiy Storchaka2024-04-122-26/+100
|
* gh-117764: Add signatures for functions in the faulthandler module (GH-117771)Serhiy Storchaka2024-04-121-26/+35
|
* gh-117764: Add signature for functools.partial() (GH-117775)Serhiy Storchaka2024-04-121-2/+3
|
* gh-117764: Add signatures and improve docstrings in the _thread module ↵Serhiy Storchaka2024-04-121-46/+126
| | | | (GH-117772)
* gh-117764: Add signatures for some objects in the itertools module (GH-117774)Serhiy Storchaka2024-04-121-3/+6
|
* gh-117764: Add signatures in the atexit module (GH-117776)Serhiy Storchaka2024-04-121-5/+10
|
* gh-117764: Add signatures for __reduce__ and __reduce_ex__ in the _io module ↵Serhiy Storchaka2024-04-123-10/+10
| | | | | | (GH-117773) __reduce__() does not have parameters, __reduce_ex__() has a single parameter.
* gh-117764: Add docstrings and signatures for the __replace__ methods (GH-117768)Serhiy Storchaka2024-04-121-3/+6
|
* gh-76785: Handle Legacy Interpreters Properly (gh-117490)Eric Snow2024-04-112-89/+216
| | | This is similar to the situation with threading._DummyThread. The methods (incl. __del__()) of interpreters.Interpreter objects must be careful with interpreters not created by interpreters.create(). The simplest thing to start with is to disable any method that modifies or runs in the interpreter. As part of this, the runtime keeps track of where an interpreter was created. We also handle interpreter "refcounts" properly.
* gh-116738: Make _abc module thread-safe (#117488)Brett Simmers2024-04-111-115/+147
| | | | A collection of small changes aimed at making the `_abc` module safe to use in a free-threaded build.
* gh-117233: Detect support for several hashes at hashlib build time (GH-117234)Will Childs-Klein2024-04-111-10/+59
| | | | | | | | | | | | | | | | | | | | | | | Detect libcrypto BLAKE2, Shake, SHA3, and Truncated-SHA512 support at hashlib build time ## BLAKE2 While OpenSSL supports both "b" and "s" variants of the BLAKE2 hash function, other cryptographic libraries may lack support for one or both of the variants. This commit modifies `hashlib`'s C code to detect whether or not the linked libcrypto supports each BLAKE2 variant, and elides references to each variant's NID accordingly. In cases where the underlying libcrypto doesn't fully support BLAKE2, CPython's `./configure` script can be given the following flag to use CPython's interned BLAKE2 implementation: `--with-builtin-hashlib-hashes=blake2`. ## SHA3, Shake, & truncated SHA512. Detect BLAKE2, SHA3, Shake, & truncated SHA512 support in the OpenSSL-ish libcrypto library at build time. This helps allow hashlib's `_hashopenssl` to be used with libraries that do not to support every algorithm that upstream OpenSSL does. Such as AWS-LC & BoringSSL. Co-authored-by: Gregory P. Smith [Google LLC] <greg@krypto.org>
* gh-76785: Add More Tests to test_interpreters.test_api (gh-117662)Eric Snow2024-04-114-127/+422
| | | In addition to the increase test coverage, this is a precursor to sorting out how we handle interpreters created directly via the C-API.
* gh-117142: Port _ctypes to multi-phase init (GH-117181)neonene2024-04-107-178/+1109
|
* gh-117534: Add checking for input parameter in iso_to_ymd (#117543)Vlad48962024-04-091-7/+9
| | | | | | | Moves the validation for invalid years in the C implementation of the `datetime` module into a common location between `fromisoformat` and `fromisocalendar`, which improves the error message and fixes a failed assertion when parsing invalid ISO 8601 years using one of the "ISO weeks" formats. --------- Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
* gh-116720: Fix corner cases of taskgroups (#117407)Guido van Rossum2024-04-091-0/+3
| | | | | | | | | | This prevents external cancellations of a task group's parent task to be dropped when an internal cancellation happens at the same time. Also strengthen the semantics of uncancel() to clear self._must_cancel when the cancellation count reaches zero. Co-Authored-By: Tin Tvrtković <tinchester@gmail.com> Co-Authored-By: Arthur Tacca
* gh-111926: Make weakrefs thread-safe in free-threaded builds (#117168)mpage2024-04-086-52/+38
| | | | | | | | | Most mutable data is protected by a striped lock that is keyed on the referenced object's address. The weakref's hash is protected using the weakref's per-object lock. Note that this only affects free-threaded builds. Apart from some minor refactoring, the added code is all either gated by `ifdef`s or is a no-op (e.g. `Py_BEGIN_CRITICAL_SECTION`).
* gh-111140: PyLong_From/AsNativeBytes: Take *flags* rather than just ↵Steve Dower2024-04-051-7/+7
| | | | *endianness* (GH-116053)
* gh-117435: Make `SemLock` thread-safe in free-threaded build (#117436)Sam Gross2024-04-042-9/+37
| | | | Use critical sections to make acquire, release, and _count thread-safe without the GIL.
* gh-116968: Reimplement Tier 2 counters (#117144)Guido van Rossum2024-04-041-0/+6
| | | | | | | | | | | | Introduce a unified 16-bit backoff counter type (``_Py_BackoffCounter``), shared between the Tier 1 adaptive specializer and the Tier 2 optimizer. The API used for adaptive specialization counters is changed but the behavior is (supposed to be) identical. The behavior of the Tier 2 counters is changed: - There are no longer dynamic thresholds (we never varied these). - All counters now use the same exponential backoff. - The counter for ``JUMP_BACKWARD`` starts counting down from 16. - The ``temperature`` in side exits starts counting down from 64.
* gh-117267: Ensure DirEntry.stat().st_ctime still contains creation time ↵Steve Dower2024-04-031-0/+4
| | | | during deprecation period (GH-117354)
* gh-114329: Fix PyList_GetItemRef() limited C API definition (#117520)Victor Stinner2024-04-035-4/+10
|
* gh-116168: Remove extra `_CHECK_STACK_SPACE` uops (#117242)Peter Lazorchak2024-04-031-0/+12
| | | This merges all `_CHECK_STACK_SPACE` uops in a trace into a single `_CHECK_STACK_SPACE_OPERAND` uop that checks whether there is enough stack space for all calls included in the entire trace.
* gh-76785: Raise InterpreterError, Not RuntimeError (gh-117489)Eric Snow2024-04-031-4/+4
| | | | | I had meant to switch everything to InterpreterError when I added it a while back. At the time I missed a few key spots. As part of this, I've added print-the-exception to _PyXI_InitTypes() and fixed an error case in `_PyStaticType_InitBuiltin().
* GH-114847: Raise FileNotFoundError when getcwd() returns '(unreachable)' ↵Barney Gale2024-04-031-0/+14
| | | | | | | | | (#117481) On Linux >= 2.6.36 with glibc < 2.27, `getcwd()` can return a relative pathname starting with '(unreachable)'. We detect this and fail with ENOENT, matching new glibc behaviour. Co-authored-by: Petr Viktorin <encukou@gmail.com>
* gh-91565: Update issue tracker URL in error message. (#117450)Ezio Melotti2024-04-031-2/+2
| | | | | * Update issue tracker URL in commit message. * Also update issue tracker URL in comment.
* gh-76785: Consolidate Some Interpreter-related Testing Helpers (gh-117485)Eric Snow2024-04-022-250/+249
| | | This eliminates the duplication of functionally identical helpers in the _testinternalcapi and _xxsubinterpreters modules.
* gh-76785: Add PyInterpreterConfig Helpers (gh-117170)Eric Snow2024-04-021-60/+146
| | | These helpers make it easier to customize and inspect the config used to initialize interpreters. This is especially valuable in our tests. I found inspiration from the PyConfig API for the PyInterpreterConfig dict conversion stuff. As part of this PR I've also added a bunch of tests.
* gh-117440: Make `syslog` thread-safe in free-threaded builds (#117441)Sam Gross2024-04-022-5/+19
| | | Use critical sections to protect access to the syslog module.
* GH-115776: Embed the values array into the object, for "normal" Python ↵Mark Shannon2024-04-023-6/+21
| | | | objects. (GH-116115)
* gh-94808: Fix refcounting in PyObject_Print tests (GH-117421)Petr Viktorin2024-04-011-0/+4
|
* gh-117142: ctypes: Unify meta tp slot functions (GH-117143)neonene2024-04-013-73/+46
| | | | | | | Integrates the following ctypes meta tp slot functions: * `CDataType_traverse()` into `CType_Type_traverse()`. * `CDataType_clear()` into `CType_Type_clear()`. * `CDataType_dealloc()` into `CType_Type_dealloc()`. * `CDataType_repeat()` into `CType_Type_repeat()`.
* gh-94808:Improve coverage of PyObject_Print (GH-98749)MonadChains2024-04-014-1/+138
|
* gh-117142: ctypes: Migrate global vars to module state (GH-117189)neonene2024-03-296-222/+235
|
* gh-117310: Remove extra DECREF on "no ciphers" error path in ↵Gregory P. Smith2024-03-281-1/+0
| | | | | | | | | | `_ssl._SSLContext` constructor (#117309) Remove extra self DECREF on ssl "no ciphers" error path. This doesn't come up in practice because nobody links against a broken OpenSSL library that provides nothing.
* gh-115627: Fix PySSL_SetError handling SSL_ERROR_SYSCALL (GH-115628)yevgeny hong2024-03-261-30/+18
| | | | | | | | | | | | | | | | | Python 3.10 changed from using SSL_write() and SSL_read() to SSL_write_ex() and SSL_read_ex(), but did not update handling of the return value. Change error handling so that the return value is not examined. OSError (not EOF) is now returned when retval is 0. According to *recent* man pages of all functions for which we call PySSL_SetError, (in OpenSSL 3.0 and 1.1.1), their return value should be used to determine whether an error happened (i.e. if PySSL_SetError should be called), but not what kind of error happened (so, PySSL_SetError shouldn't need retval). To get the error, we need to use SSL_get_error. Co-authored-by: Serhiy Storchaka <storchaka@gmail.com> Co-authored-by: Petr Viktorin <encukou@gmail.com>
* gh-99108: Refresh HACL*; update modules accordingly; fix namespacing (GH-117237)Jonathan Protzenko2024-03-2621-1813/+1567
| | | Pulls in a new update from https://github.com/hacl-star/hacl-star and fixes our C "namespacing" done by `Modules/_hacl/refresh.sh`.