summaryrefslogtreecommitdiffstats
path: root/Modules
Commit message (Collapse)AuthorAgeFilesLines
* gh-94673: More Per-Interpreter Fields for Builtin Static Types (gh-103912)Eric Snow2023-05-032-28/+4
| | | | | his involves moving tp_dict, tp_bases, and tp_mro to PyInterpreterState, in the same way we did for tp_subclasses. Those three fields are effectively const for builtin static types (unlike tp_subclasses). In theory we only need to make their values immortal, along with their contents. However, that isn't such a simple proposition. (See gh-103823.) In the meantime the simplest solution is to move the fields into the interpreter. One alternative is to statically allocate the values, but that's its own can of worms.
* gh-84436: Add integration C API tests for immortal objects (gh-103962)Dong-hee Na2023-05-024-1/+52
|
* gh-103743: Add PyUnstable_Object_GC_NewWithExtraData (GH-103744)Jurica Bradarić2023-05-022-1/+117
| | | | Co-authored-by: Petr Viktorin <encukou@gmail.com> Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
* gh-94673: Hide Objects in PyTypeObject Behind Accessors (gh-104074)Eric Snow2023-05-021-3/+4
| | | This makes it much cleaner to move more PyTypeObject fields to PyInterpreterState.
* gh-94673: Properly Initialize and Finalize Static Builtin Types for Each ↵Eric Snow2023-05-021-6/+2
| | | | | Interpreter (gh-104072) Until now, we haven't been initializing nor finalizing the per-interpreter state properly.
* gh-87092: Expose assembler to unit tests (#103988)Irit Katriel2023-05-012-2/+127
|
* gh-97696: asyncio eager tasks factory (#102853)Itamar Ostricher2023-05-012-21/+436
| | | | Co-authored-by: Jacob Bower <jbower@meta.com> Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
* Fix typo in "expected" word in few source files (#104034)chgnrdv2023-05-011-1/+1
|
* gh-104028: Reduce object creation while calling callback function from gc ↵Dong-hee Na2023-05-011-1/+11
| | | | (gh-104030)
* gh-103793: Defer formatting task name (#103767)Itamar Ostricher2023-04-291-2/+11
| | | | | | | | | | | | | The default task name is "Task-<counter>" (if no name is passed in during Task creation). This is initialized in `Task.__init__` (C impl) using string formatting, which can be quite slow. Actually using the task name in real world code is not very common, so this is wasted init. Let's defer this string formatting to the first time the name is read (in `get_name` impl), so we don't need to pay the string formatting cost if the task name is never read. We don't change the order in which tasks are assigned numbers (if they are) -- the number is set on task creation, as a PyLong instead of a formatted string. Co-authored-by: Łukasz Langa <lukasz@langa.pl>
* gh-98040: Remove just the `imp` module (#98573)Barry Warsaw2023-04-281-12/+0
|
* GH-103944: Check error status when raising DeprecationWarning (#103949)Paul Ganssle2023-04-281-12/+12
|
* Fix typo in math.log docstring (#103943)Wes Turner2023-04-281-1/+1
|
* gh-94673: Ensure Builtin Static Types are Readied Properly (gh-103940)Eric Snow2023-04-273-14/+5
| | | There were cases where we do unnecessary work for builtin static types. This also simplifies some work necessary for a per-interpreter GIL.
* GH-103857: Deprecate utcnow and utcfromtimestamp (#103858)Paul Ganssle2023-04-271-0/+14
| | | | | Using `datetime.datetime.utcnow()` and `datetime.datetime.utcfromtimestamp()` will now raise a `DeprecationWarning`. We also have removed our internal uses of these functions and documented the change.
* gh-102765: Update ntpath.isdir/isfile/islink/exists to use ↵Finn Womack2023-04-271-118/+191
| | | | GetFileInformationByName when available (GH-103485)
* gh-103583: Isolate CJK codec modules (#103869)Erlend E. Aasland2023-04-277-205/+226
|
* gh-103092: Isolate _ctypes, part 1 (#103893)Erlend E. Aasland2023-04-276-195/+227
| | | | | | | | | Establish global state and port the following types to heap types: - DictRemover_Type - PyCArg_Type - PyCThunk_Type - PyCField_Type - StructParam_Type
* gh-89415: Add source-specific multicast constants to socket module (#103684)Reese Hyde2023-04-271-0/+12
| | | | | Add socket options for source-specific multicast when present as C #defines. Co-authored-by: Oleg Iarygin <dralife@yandex.ru>
* gh-103489: Add get/set config methods to sqlite3.Connection (#103506)Erlend E. Aasland2023-04-263-1/+240
|
* gh-103015: Add entrypoint keyword param to sqlite3.Connection.load_extension ↵Erlend E. Aasland2023-04-262-12/+70
| | | | (#103073)
* gh-101659: Isolate "obmalloc" State to Each Interpreter (gh-101660)Eric Snow2023-04-241-2/+10
| | | | | | | | | | | | | | This is strictly about moving the "obmalloc" runtime state from `_PyRuntimeState` to `PyInterpreterState`. Doing so improves isolation between interpreters, specifically most of the memory (incl. objects) allocated for each interpreter's use. This is important for a per-interpreter GIL, but such isolation is valuable even without it. FWIW, a per-interpreter obmalloc is the proverbial canary-in-the-coalmine when it comes to the isolation of objects between interpreters. Any object that leaks (unintentionally) to another interpreter is highly likely to cause a crash (on debug builds at least). That's a useful thing to know, relative to interpreter isolation.
* gh-94518: Port 23-argument `_posixsubprocess.fork_exec` to Argument Clinic ↵Oleg Iarygin2023-04-242-66/+255
| | | | | | | (#94519) Convert fork_exec to pre-inlined-argparser Argument Clinic Co-authored-by: Gregory P. Smith <greg@krypto.org>
* gh-103091: Add PyUnstable_Type_AssignVersionTag (#103095)Brett Simmers2023-04-241-0/+13
|
* gh-103712: Increase the length of the type name in AttributeError messages ↵Alex Gaynor2023-04-241-1/+1
| | | | (#103713)
* gh-101408: PyObject_GC_Resize should calculate preheader size. (gh-101741)Dong-hee Na2023-04-231-6/+7
|
* gh-84436: Implement Immortal Objects (gh-19474)Eddie Elizondo2023-04-221-1/+14
| | | | | | | | | This is the implementation of PEP683 Motivation: The PR introduces the ability to immortalize instances in CPython which bypasses reference counting. Tagging objects as immortal allows up to skip certain operations when we know that the object will be around for the entire execution of the runtime. Note that this by itself will bring a performance regression to the runtime due to the extra reference count checks. However, this brings the ability of having truly immutable objects that are useful in other contexts such as immutable data sharing between sub-interpreters.
* gh-83861: Fix datetime.astimezone() method (GH-101545)Alexander Belopolsky2023-04-191-2/+16
|
* gh-103583: Add ref. dependency between multibytecodec modules (#103589)Erlend E. Aasland2023-04-193-14/+58
|
* gh-103583: Always pass multibyte codec structs as const (#103588)Erlend E. Aasland2023-04-192-7/+7
|
* gh-103617: Fix compiler warning in _iomodule.c (#103618)Erlend E. Aasland2023-04-191-2/+3
|
* gh-103583: Add codecs and maps to _codecs_* module state (#103540)Erlend E. Aasland2023-04-178-94/+161
|
* gh-103532: Remove TKINTER_PROTECT_LOADTK code (GH-103535)Christopher Chavez2023-04-143-79/+0
| | | | This was only needed for Tk 8.4.13 and older, but Tkinter already requires at least 8.5.12.
* gh-67230: add quoting rules to csv module (GH-29469)Skip Montanaro2023-04-121-1/+15
| | | | | | Add two quoting styles for csv dialects. They will help to work with certain databases in particular. Automerge-Triggered-By: GH:merwok
* gh-103092: Isolate `_collections` (#103093)Erlend E. Aasland2023-04-122-278/+281
| | | Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
* gh-103092: Isolate `socket` module (#103094)Erlend E. Aasland2023-04-092-161/+234
|
* gh-103242: Migrate SSLContext.set_ecdh_curve not to use deprecated APIs ↵Dong-hee Na2023-04-081-3/+8
| | | | | (#103378) Migrate `SSLContext.set_ecdh_curve()` not to use deprecated OpenSSL APIs.
* gh-83004: Harden _socket init (GH-103261)Erlend E. Aasland2023-04-071-537/+581
| | | Automerge-Triggered-By: GH:erlend-aasland
* gh-103256: Fix hmac algorithm to support fallback implementation (gh-103286)Dong-hee Na2023-04-071-1/+1
| | | Co-authored-by: Gregory P. Smith <greg@krypto.org>
* gh-101659: Add _Py_AtExit() (gh-103298)Eric Snow2023-04-064-32/+164
| | | | | The function is like Py_AtExit() but for a single interpreter. This is a companion to the atexit module's register() function, taking a C callback instead of a Python one. We also update the _xxinterpchannels module to use _Py_AtExit(), which is the motivating case. (This is inspired by pain points felt while working on gh-101660.)
* gh-101659: Use the Raw Allocator in the _xxinterpchannels Module (gh-103287)Eric Snow2023-04-051-22/+93
| | | Using the raw allocator for any of the global state makes sense, especially as we move to a per-interpreter obmalloc state (gh-101660).
* gh-103167: Fix `-Wstrict-prototypes` warnings by using `(void)` for ↵Nikita Sobolev2023-04-052-3/+3
| | | | functions with no args (GH-103168)
* GH-75586: Make shutil.which() on Windows more consistent with the OS (GH-103179)Charles Machalow2023-04-042-1/+62
|
* Fix a compiler warning in _xxsubinterpretermodule.c (#103245)T. Wouters2023-04-041-1/+1
| | | | | | | Fix a (correct) warning about potential uses of uninitialized memory in _xxsubinterpreter. Unlike newly allocated PyObject structs or global structs, stack-allocated structs are not initialised, and a few places in the code expect the _sharedexception struct data to be either NULL or initialised.
* gh-103092: Isolate `_pickle` module (#102982)Erlend E. Aasland2023-04-042-664/+674
| | | | Co-authored-by: Mohamed Koubaa <koubaa.m@gmail.com> Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
* gh-100062: Remove error code tables from _ssl and err_names_to_codes (GH-100063)David Benjamin2023-04-032-15/+0
| | | | | | | | | | Prior to https://github.com/python/cpython/pull/25300, the make_ssl_data.py script used various tables, exposed in _ssl, to update the error list. After that PR, this is no longer used. Moreover, the err_names_to_codes map isn't used at all. Clean those up. This gets them out of the way if, in the future, OpenSSL provides an API to do what the code here is doing directly. (https://github.com/openssl/openssl/issues/19848)
* GH-103182: use vectorcall in `_asyncio` instead of variadic calling APIs ↵Kumar Aditya2023-04-031-22/+17
| | | | (#103175)
* fix typo in _ssl.c (GH-103192)Ikko Eltociear Ashimine2023-04-021-1/+1
| | | | | seperated -> separated Automerge-Triggered-By: GH:AlexWaygood
* Add IPv6 into to the docstring for socket.getsockname (#102961)Brian Haley2023-03-301-1/+2
| | | Signed-off-by: Brian Haley <haleyb.dev@gmail.com>
* Fix typos in faulthandler, testcapi error messages (#103020)Liyang Zhang2023-03-252-3/+3
|