summaryrefslogtreecommitdiffstats
path: root/Modules
Commit message (Collapse)AuthorAgeFilesLines
* gh-116322: Add Py_mod_gil module slot (#116882)Brett Simmers2024-05-03102-32/+200
| | | | | | | | | | | | | | This PR adds the ability to enable the GIL if it was disabled at interpreter startup, and modifies the multi-phase module initialization path to enable the GIL when loading a module, unless that module's spec includes a slot indicating it can run safely without the GIL. PEP 703 called the constant for the slot `Py_mod_gil_not_used`; I went with `Py_MOD_GIL_NOT_USED` for consistency with gh-104148. A warning will be issued up to once per interpreter for the first GIL-using module that is loaded. If `-v` is given, a shorter message will be printed to stderr every time a GIL-using module is loaded (including the first one that issues a warning).
* gh-101732: Modules/_ssl.c: use Y2038 compatible openssl function when ↵Alexander Kanavin2024-05-031-0/+4
| | | | available (GH-118425)
* gh-116126: Implement PEP 696 (#116129)Jelle Zijlstra2024-05-031-0/+3
| | | | | Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com> Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com> Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
* gh-117953: Other Cleanups in the Extensions Machinery (gh-118206)Eric Snow2024-05-031-1/+167
| | | This change will make some later changes simpler.
* gh-118486: Switch mkdir(mode=0o700) on Windows to use OWNER RIGHTS instead ↵Steve Dower2024-05-021-3/+16
| | | | of CURRENT_USER (GH-118515)
* gh-93502: Add new C-API functions to trace object creation and destruction ↵Pablo Galindo Salgado2024-05-021-0/+84
| | | | (#115945)
* gh-82062: Fix support of parameter defaults on methods in extension modules ↵Sergey B Kirpichev2024-05-021-0/+10
| | | | | | | | | (GH-115270) Now inspect.signature() supports references to the module globals in parameter defaults on methods in extension modules. Previously it was only supported in functions. The workaround was to specify the fully qualified name, including the module name.
* gh-118486: Support mkdir(mode=0o700) on Windows (GH-118488)Steve Dower2024-05-021-2/+156
|
* gh-110850: Add PyTime_TimeRaw() function (#118394)Victor Stinner2024-05-011-0/+60
| | | | | | | | | | | | | | | | | Add "Raw" variant of PyTime functions: * PyTime_MonotonicRaw() * PyTime_PerfCounterRaw() * PyTime_TimeRaw() Changes: * Add documentation and tests. Tests release the GIL while calling raw clock functions. * py_get_system_clock() and py_get_monotonic_clock() now check that the GIL is hold by the caller if raise_exc is non-zero. * Reimplement "Unchecked" functions with raw clock functions. Co-authored-by: Petr Viktorin <encukou@gmail.com>
* gh-118335: Configure Tier 2 interpreter at build time (#118339)Guido van Rossum2024-05-012-1/+18
| | | | | | | | | | | | | | | | | | | | | | The code for Tier 2 is now only compiled when configured with `--enable-experimental-jit[=yes|interpreter]`. We drop support for `PYTHON_UOPS` and -`Xuops`, but you can disable the interpreter or JIT at runtime by setting `PYTHON_JIT=0`. You can also build it without enabling it by default using `--enable-experimental-jit=yes-off`; enable with `PYTHON_JIT=1`. On Windows, the `build.bat` script supports `--experimental-jit`, `--experimental-jit-off`, `--experimental-interpreter`. In the C code, `_Py_JIT` is defined as before when the JIT is enabled; the new variable `_Py_TIER2` is defined when the JIT *or* the interpreter is enabled. It is actually a bitmask: 1: JIT; 2: default-off; 4: interpreter.
* gh-118422: Fix run_fileexflags() test (#118429)Victor Stinner2024-04-301-7/+6
| | | | | Don't test the undefined behavior of fileno() on a closed file, but use fstat() as a reliable test if the file was closed or not.
* gh-118218: Reuse return tuple in itertools.pairwise (GH-118219)Shantanu2024-04-301-2/+32
|
* gh-118406: Add signature for sqlite3.Connection objects (#118428)Erlend E. Aasland2024-04-301-0/+7
|
* gh-118332: Fix deadlock involving stop the world (#118412)Sam Gross2024-04-302-1/+87
| | | | | | Avoid detaching thread state when stopping the world. When re-attaching the thread state, the thread would attempt to resume the top-most critical section, which might now be held by a thread paused for our stop-the-world request.
* gh-118379: Use PyTuple_Pack instead of Py_BuildValue if possible (GH-118381)Nice Zombies2024-04-305-7/+7
|
* gh-118402: Fix inspect.signature() for functools.cmp_to_key() result (GH-118427)Serhiy Storchaka2024-04-301-0/+12
|
* gh-117783: Immortalize objects that use deferred reference counting (#118112)Sam Gross2024-04-291-0/+22
| | | | | | | | | Deferred reference counting is not fully implemented yet. As a temporary measure, we immortalize objects that would use deferred reference counting to avoid multi-threaded scaling bottlenecks. This is only performed in the free-threaded build once the first non-main thread is started. Additionally, some tests, including refleak tests, suppress this behavior.
* gh-118285: Fix signatures of operator.{attrgetter,itemgetter,methodcaller} ↵Serhiy Storchaka2024-04-291-0/+15
| | | | | | | | | instances (GH-118316) * Allow to specify the signature of custom callable instances of extension type by the __text_signature__ attribute. * Specify signatures of operator.attrgetter, operator.itemgetter, and operator.methodcaller instances.
* gh-115119: Detect _decimal dependencies using pkg-config (#115406)Erlend E. Aasland2024-04-291-1/+13
| | | pkg-config is supported for libmpdec 4.0.0 and newer.
* gh-118293: Suppress mouse cursor feedback when launching Windows processes ↵Henrik Tunedal2024-04-281-0/+48
| | | | with multiprocessing (GH-118315)
* gh-110693: Pending Calls Machinery Cleanups (gh-118296)Eric Snow2024-04-262-32/+84
| | | This does some cleanup in preparation for later changes.
* gh-117578: Introduce _PyType_GetModuleByDef2 private function (GH-117661)neonene2024-04-251-5/+3
| | | | Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com> Co-authored-by: Petr Viktorin <encukou@gmail.com>
* gh-102511: Speed up os.path.splitroot() with native helpers (GH-118089)Nice Zombies2024-04-252-1/+103
|
* gh-117968: Make the test for closed file more safe in the C API tests ↵Serhiy Storchaka2024-04-251-2/+4
| | | | | | | | (GH-118230) The behavior of fileno() after fclose() is undefined, but it is the only practical way to check whether the file was closed. Only test this on the known platforms (Linux, Windows, macOS), where we already tested that it works.
* gh-117786: Fix venv created from Windows Store install by restoring ↵Steve Dower2024-04-241-10/+14
| | | | __PYVENV_LAUNCHER__ smuggling (GH-117814)
* gh-76785: Rename _xxsubinterpreters to _interpreters (gh-117791)Eric Snow2024-04-245-9/+10
| | | See https://discuss.python.org/t/pep-734-multiple-interpreters-in-the-stdlib/41147/26.
* gh-117151: optimize BufferedWriter(), do not buffer writes that are the ↵morotti2024-04-231-2/+2
| | | | | | | | | buffer size (GH-118037) BufferedWriter() was buffering calls that are the exact same size as the buffer. it's a very common case to read/write in blocks of the exact buffer size. it's pointless to copy a full buffer, it's costing extra memory copy and the full buffer will have to be written in the next call anyway. Co-authored-by: rmorotti <romain.morotti@man.com>
* gh-68114: Fix handling for removed PyArg_ParseTuple 'w' formatters (GH-8204)Joe Jevnik2024-04-231-0/+118
| | | | Co-authored-by: Joe Jevnik <joe@quantopian.com> Co-authored-by: Petr Viktorin <encukou@gmail.com>
* 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
|