summaryrefslogtreecommitdiffstats
path: root/Modules
Commit message (Collapse)AuthorAgeFilesLines
* gh-126623: Update libexpat to 2.6.4, make future updates easier (GH-126792)Seth Michael Larson2024-11-134-11/+79
| | | Update libexpat to 2.6.4, make future updates easier.
* gh-123619: Add an unstable C API function for enabling deferred reference ↵Peter Bierma2024-11-132-1/+17
| | | | | | counting (GH-123635) Co-authored-by: Sam Gross <colesbury@gmail.com>
* gh-126688: Reinit import lock after fork (#126692)Sam Gross2024-11-121-0/+1
| | | | | | The PyMutex implementation supports unlocking after fork because we clear the list of waiters in parking_lot.c. This doesn't work as well for _PyRecursiveMutex because on some systems, such as SerenityOS, the thread id is not preserved across fork().
* gh-76785: Improved Subinterpreters Compatibility with 3.12 (2/2) (gh-126707)Eric Snow2024-11-125-12/+46
| | | | | | | | | These changes makes it easier to backport the _interpreters, _interpqueues, and _interpchannels modules to Python 3.12. This involves the following: * add the _PyXI_GET_STATE() and _PyXI_GET_GLOBAL_STATE() macros * add _PyXIData_lookup_context_t and _PyXIData_GetLookupContext() * add _Py_xi_state_init() and _Py_xi_state_fini()
* gh-95382: Use cache for indentations in the JSON encoder (GH-118636)Serhiy Storchaka2024-11-121-64/+118
|
* gh-126133: Only use start year in PSF copyright, remove end years (#126236)Hugo van Kemenade2024-11-123-3/+3
|
* gh-126061: Add PyLong_IsPositive/Zero/Negative() functions (#126065)RUANG (James Roy)2024-11-121-0/+27
| | | | | Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com> Co-authored-by: Peter Bierma <zintensitydev@gmail.com> Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
* gh-125916: Allow functools.reduce() 'initial' to be a keyword argument (#125917)Sayandip Dutta2024-11-122-10/+39
|
* gh-126595: fix a crash when calling `itertools.count(sys.maxsize)` (#126617)Bénédikt Tran2024-11-121-0/+3
|
* gh-126405: fix use-after-free in `_asyncio.Future.remove_done_callback` ↵Kumar Aditya2024-11-121-0/+2
| | | | (#126733)
* gh-76785: Improved Subinterpreters Compatibility with 3.12 (1/2) (gh-126704)Eric Snow2024-11-111-1/+1
| | | | | | | | | These changes makes it easier to backport the _interpreters, _interpqueues, and _interpchannels modules to Python 3.12. This involves the following: * rename several structs and typedefs * add several typedefs * stop using the PyThreadState.state field directly in parking_lot.c
* gh-76785: Minor Cleanup of Exception-related Cross-interpreter State (gh-126602)Eric Snow2024-11-111-1/+1
| | | This change makes it easier to backport the _interpreters, _interpqueues, and _interpchannels modules to Python 3.12.
* gh-126654: Fix crash in several functions in `_interpreters` module (#126678)sobolevn2024-11-111-0/+5
|
* remove minor redundant code from `_asyncio` (#126578)Kumar Aditya2024-11-081-3/+1
|
* GH-107803: use circular double linked list for tasks in `_asyncio` (#126577)Kumar Aditya2024-11-081-52/+21
|
* gh-122943: Add the varpos parameter in _PyArg_UnpackKeywords (GH-126564)Serhiy Storchaka2024-11-0862-492/+922
| | | | Remove _PyArg_UnpackKeywordsWithVararg. Add comments for integer arguments of _PyArg_UnpackKeywords.
* gh-122943: Remove the object converter for var-positional parameter (GH-126560)Serhiy Storchaka2024-11-081-38/+38
|
* gh-122943: Rework support of var-positional parameter in Argument Clinic ↵Serhiy Storchaka2024-11-077-211/+1065
| | | | | | | | | | | | | | | | | | (GH-122945) Move creation of a tuple for var-positional parameter out of _PyArg_UnpackKeywordsWithVararg(). Merge _PyArg_UnpackKeywordsWithVararg() with _PyArg_UnpackKeywords(). Add a new parameter in _PyArg_UnpackKeywords(). The "parameters" and "converters" attributes of ParseArgsCodeGen no longer contain the var-positional parameter. It is now available as the "varpos" attribute. Optimize code generation for var-positional parameter and reuse the same generating code for functions with and without keyword parameters. Add special converters for var-positional parameter. "tuple" represents it as a Python tuple and "array" represents it as a continuous array of PyObject*. "object" is a temporary alias of "tuple".
* gh-76785: Minor Cleanup of "Cross-interpreter" Code (gh-126457)Eric Snow2024-11-075-97/+82
| | | | | | | | The primary objective here is to allow some later changes to be cleaner. Mostly this involves renaming things and moving a few things around. * CrossInterpreterData -> XIData * crossinterpdatafunc -> xidatafunc * split out pycore_crossinterp_data_registry.h * add _PyXIData_lookup_t
* Cleanup multiprocessing comment and unusual import error message (#126532)Gregory P. Smith2024-11-071-0/+1
| | | | Define constants as constants rather than calling `list(range(2))`. Explain which values must remain in sync via comments.
* gh-125631: Enable setting persistent_id and persistent_load of pickler and ↵Serhiy Storchaka2024-11-071-0/+62
| | | | | | | unpickler (GH-125752) pickle.Pickler.persistent_id and pickle.Unpickler.persistent_load can again be overridden as instance attributes.
* gh-126461: Fix _Unpickler_ReadFromFile() error handling (#126485)Victor Stinner2024-11-061-0/+4
| | | Handle _Unpickler_SetStringInput() failure.
* gh-126455: Disallow _ssl.SSLSocket instantiation (#126481)Victor Stinner2024-11-061-1/+1
| | | | Prevent creation of incomplete/invalid _ssl.SSLSocket objects when created directly.
* gh-126433: Change channel_info.count to int64_t (#126447)Victor Stinner2024-11-061-1/+1
| | | | Fix compiler warnings on 32-bit Windows: change channel_info.count type from Py_ssize_t to int64_t in _interpchannelsmodule.c.
* gh-126433: Fix compiler warnings on 32-bit Windows (#126444)Victor Stinner2024-11-054-9/+11
|
* gh-126425: Refactor `_lsprof_Profiler_enable` (#126426)sobolevn2024-11-051-12/+25
| | | | - Explicit memory management for `None` objects (since we still try to treat immortal objects as regular objects) - Respect possible errors of `sys.monitoring.register_callback` call
* gh-119793: Prefer `map(..., strict=True)` over starmap/zip in examples (#126407)Lukas Geiger2024-11-052-4/+4
|
* gh-126303: Fix pickling and copying of os.sched_param objects (GH-126336)Serhiy Storchaka2024-11-051-0/+17
|
* gh-115999: Implement thread-local bytecode and enable specialization for ↵mpage2024-11-042-1/+48
| | | | | | | | | `BINARY_OP` (#123926) Each thread specializes a thread-local copy of the bytecode, created on the first RESUME, in free-threaded builds. All copies of the bytecode for a code object are stored in the co_tlbc array on the code object. Threads reserve a globally unique index identifying its copy of the bytecode in all co_tlbc arrays at thread creation and release the index at thread destruction. The first entry in every co_tlbc array always points to the "main" copy of the bytecode that is stored at the end of the code object. This ensures that no bytecode is copied for programs that do not use threads. Thread-local bytecode can be disabled at runtime by providing either -X tlbc=0 or PYTHON_TLBC=0. Disabling thread-local bytecode also disables specialization. Concurrent modifications to the bytecode made by the specializing interpreter and instrumentation use atomics, with specialization taking care not to overwrite an instruction that was instrumented concurrently.
* gh-126220: Adapt `_lsprof` to Argument Clinic (#126233)sobolevn2024-11-042-117/+496
| | | Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
* gh-126313: Fix a crash in curses.napms() due to incorrect error handling ↵Bénédikt Tran2024-11-031-2/+5
| | | | (GH-126351)
* gh-126138: Fix use-after-free in `_asyncio.Task` by evil `__getattribute__` ↵Nico-Posada2024-11-021-2/+20
| | | | | (#126305) Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
* gh-120026: soft deprecate Py_HUGE_VAL macro (#120027)Sergey B Kirpichev2024-11-012-8/+8
| | | Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
* gh-126220: Fix crash on calls to `_lsprof.Profiler` methods with 0 args ↵sobolevn2024-11-011-0/+24
| | | | | (backportable) (#126271) Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
* gh-120754: _io Ensure stat cache is cleared on fd change (#125166)Cody Maloney2024-11-011-5/+6
| | | | | | | | Performed an audit of `fileio.c` and `_pyio` and made sure anytime the fd changes the stat result, if set, is also cleared/changed. There's one case where it's not cleared, if code would clear it in __init__, keep the memory allocated and just do another fstat with the existing memory.
* gh-125916: Adapt functools.reduce() to Argument Clinic (#125999)Sergey B Kirpichev2024-11-012-20/+68
|
* gh-126080: fix UAF on `task->task_context` in `task_call_step_soon` due to ↵Bénédikt Tran2024-10-311-1/+5
| | | | an evil `loop.__getattribute__` (#126120)
* gh-101123: Adapt vararg functions in the math module to Argument Clinic ↵Sergey B Kirpichev2024-10-312-37/+143
| | | | | | (#126235) This implicitly fixes the math.hypot signature, which was previously incomprehensible to inspect.signature().
* gh-126223: Propagate unicode errors in `_interpreters.create()` (#126224)Peter Bierma2024-10-311-1/+5
| | | | Co-authored-by: sobolevn <mail@sobolevn.me> Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
* gh-90370: Argument Clinic: avoid temporary tuple creation for varargs (#126064)Sergey B Kirpichev2024-10-314-74/+95
| | | | | | | Avoid temporary tuple creation when all arguments either positional-only or vararg. Objects/setobject.c and Modules/gcmodule.c adapted. This fixes slight performance regression for set methods, introduced by gh-115112.
* gh-126083: Fix a reference leak in `asyncio.Task` when reinitializing with ↵Nico-Posada2024-10-311-1/+1
| | | | new non-`None` context (#126103)
* gh-126106: Fix `NULL` possible derefrence in `Modules/_ssl.c` (#126111)sobolevn2024-10-291-3/+3
| | | Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
* Align functools.reduce() docstring with PEP-257 (#126045)Sergey B Kirpichev2024-10-291-6/+8
| | | Yak-shave in preparation for Argument Clinic adaption in gh-125999.
* gh-126035: add missing whitespace to *Py_EnterRecursiveCall() messages (#126036)Bénédikt Tran2024-10-272-3/+3
|
* gh-125966: fix use-after-free on `fut->fut_callback0` due to an evil ↵Bénédikt Tran2024-10-271-1/+6
| | | | callback's `__eq__` in asyncio (#125967)
* gh-125984: fix use-after-free on `fut->fut_{callback,context}0` due to an ↵Bénédikt Tran2024-10-271-6/+13
| | | | evil `loop.__getattribute__` (#126003)
* gh-94512: Fix forced arg format in posixmodule.c clinic code (#122516)Bénédikt Tran2024-10-262-40/+194
|
* gh-125969: fix OOB in `future_schedule_callbacks` due to an evil `call_soon` ↵Bénédikt Tran2024-10-251-17/+12
| | | | | (#125970) Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
* GH-125789: fix `fut._callbacks` to always return a copy of callbacks (#125922)Kumar Aditya2024-10-251-28/+25
| | | Fix `asyncio.Future._callbacks` to always return a copy of the internal list of callbacks to avoid mutation from user code affecting the internal state.
* gh-115754: Use Py_GetConstant(Py_CONSTANT_EMPTY_STR) (#125583)Victor Stinner2024-10-253-5/+5
| | | | Replace PyUnicode_FromStringAndSize(NULL, 0) with Py_GetConstant(Py_CONSTANT_EMPTY_STR).