summaryrefslogtreecommitdiffstats
path: root/Doc/data
Commit message (Collapse)AuthorAgeFilesLines
* [3.12] gh-91051: fix segfault when using all 8 type watchers (GH-107853) ↵Miss Islington (bot)2023-08-161-26464/+26457
| | | | | | | | (#107876) * gh-91051: fix segfault when using all 8 type watchers (GH-107853) (cherry picked from commit 66e4edd7346b1cd65ddff6da890a0d725e325116) Co-authored-by: Carl Meyer <carl@oddbird.net>
* [3.12] gh-105699: Use a _Py_hashtable_t for the PyModuleDef Cache ↵Eric Snow2023-07-281-26484/+26464
| | | | | | | | | | | | | (gh-106974) (gh-107412) gh-105699: Use a _Py_hashtable_t for the PyModuleDef Cache (gh-106974) This fixes a crasher due to a race condition, triggered infrequently when two isolated (own GIL) subinterpreters simultaneously initialize their sys or builtins modules. The crash happened due the combination of the "detached" thread state we were using and the "last holder" logic we use for the GIL. It turns out it's tricky to use the same thread state for different threads. Who could have guessed? We solve the problem by eliminating the one object we were still sharing between interpreters. We replace it with a low-level hashtable, using the "raw" allocator to avoid tying it to the main interpreter. We also remove the accommodations for "detached" thread states, which were a dubious idea to start with. (cherry picked from commit 8ba4df91ae60833723d8d3b9afeb2b642f7176d5)
* [3.12] GH-106897: Add `RERAISE` event to `sys.monitoring`. (GH-107291) ↵Mark Shannon2023-07-281-780/+794
| | | | | | (GH-107346) * Ensures that exception handling events are balanced. Each [re]raise event has a matching unwind/handled event.
* [3.12] gh-106140: Reorder some more fields to facilitate out-of-process ↵Pablo Galindo Salgado2023-06-271-95/+95
| | | | | inspection (GH-106148) (#106155) (cherry picked from commit 9126a6a9ce3772d5dc785cbee159b07a1ff7d531)
* [3.12] gh-106140: Reorder some fields to facilitate out-of-process ↵Miss Islington (bot)2023-06-271-26470/+26470
| | | | | | | | | inspection (GH-106143) (#106147) gh-106140: Reorder some fields to facilitate out-of-process inspection (GH-106143) (cherry picked from commit 2d5a1c281161d037148ffb5983decc6d31c2557d) Signed-off-by: Pablo Galindo <pablogsal@gmail.com> Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
* [3.12] gh-104812: Run Pending Calls in any Thread (gh-104813) (gh-105752)Eric Snow2023-06-141-540/+549
| | | | For a while now, pending calls only run in the main thread (in the main interpreter). This PR changes things to allow any thread run a pending call, unless the pending call was explicitly added for the main thread to run. (cherry picked from commit 757b402)
* [3.12] gh-100227: Lock Around Modification of the Global Allocators State ↵Miss Islington (bot)2023-06-081-171/+174
| | | | | | | | (gh-105516) (gh-105532) The risk of a race with this state is relatively low, but we play it safe anyway. We do avoid using the lock in performance-sensitive cases where the risk of a race is very, very low. (cherry picked from commit 68dfa496278aa21585eb4654d5f7ef13ef76cb50) Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
* [3.12] gh-100227: Lock Around Adding Global Audit Hooks (gh-105515) (gh-105525)Eric Snow2023-06-081-1266/+1274
| | | | The risk of a race with this state is relatively low, but we play it safe anyway. (cherry picked from commit e822a676f1f3bef6c5413e9b856db481c08ac2a5)
* [3.12] gh-100227: Lock Around Use of the Global "atexit" State (gh-105514) ↵Miss Islington (bot)2023-06-081-425/+453
| | | | | | | | (gh-105517) The risk of a race with this state is relatively low, but we play it safe anyway. (cherry picked from commit 7799c8e678f759c7787785c6287140abe641d1b9) Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
* [3.12] gh-105020: Share tp_bases and tp_mro Between Interpreters For All ↵Miss Islington (bot)2023-06-011-26428/+26422
| | | | | | | | Static Builtin Types (gh-105115) (gh-105124) In gh-103912 we added tp_bases and tp_mro to each PyInterpreterState.types.builtins entry. However, doing so ignored the fact that both PyTypeObject fields are public API, and not documented as internal (as opposed to tp_subclasses). We address that here by reverting back to shared objects, making them immortal in the process. (cherry picked from commit 7be667d) Co-authored-by: Eric Snow ericsnowcurrently@gmail.com
* gh-88745: Add _winapi.CopyFile2 and update shutil.copy2 to use it (GH-105055)Miss Islington (bot)2023-05-301-959/+976
| | | | | (cherry picked from commit cda1bd3c9d3b2cecdeeba0c498cd2df83fbdb535) Co-authored-by: Steve Dower <steve.dower@python.org>
* [3.12] gh-104799: Move location of type_params AST fields (GH-104828) (#104974)Miss Islington (bot)2023-05-301-68/+68
| | | | | | | gh-104799: Move location of type_params AST fields (GH-104828) (cherry picked from commit ba73473f4c18ba4cf7ab18d84d94a47d2d37a0c5) Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com> Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
* [3.12] gh-87891: Add ABI check to CI (#104793)Petr Viktorin2023-05-231-0/+26411
| | | | | | | | | | | Backport the workflow change and fix-ups: - GH-92442 (e89c01eac7731d7cb54d43252dbc3d3f3a040c53) - GH-94129 (0dadb2249a8bafa7c5877daa08c9452f2248958a) - GH-98556 (194588decc05fa12f04cd90c3b78cc081151b19e) Co-Authored-By: sterliakov <50529348+sterliakov@users.noreply.github.com> Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com> Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
* gh-103509: PEP 697 -- Limited C API for Extending Opaque Types (GH-103511)Petr Viktorin2023-05-041-0/+2
| | | | Co-authored-by: Oleg Iarygin <oleg@arhadthedev.net> Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
* gh-102755: Add PyErr_DisplayException(exc) (#102756)Irit Katriel2023-03-161-0/+1
|
* gh-101578: Amend exception docs (#102057)Erlend E. Aasland2023-02-211-0/+2
| | | Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
* gh-101578: Amend PyErr_{Set,Get}RaisedException docs (#101962)Erlend E. Aasland2023-02-191-0/+3
| | | Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
* GH-101578: Normalize the current exception (GH-101607)Mark Shannon2023-02-081-0/+4
| | | | | | | | | | * Make sure that the current exception is always normalized. * Remove redundant type and traceback fields for the current exception. * Add new API functions: PyErr_GetRaisedException, PyErr_SetRaisedException * Add new API functions: PyException_GetArgs, PyException_SetArgs
* bpo-43327: Fix the docs for PyImport_ImportFrozenModuleObject() (#24659)Zackery Spytz2022-11-271-2/+2
| | | | | | The docs stated that PyImport_ImportFrozenModuleObject() returns a new reference, but it actually returns an int. Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
* gh-47146: Soft-deprecate structmember.h, expose its contents via Python.h ↵Petr Viktorin2022-11-221-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (GH-99014) The ``structmember.h`` header is deprecated, though it continues to be available and there are no plans to remove it. There are no deprecation warnings. Old code can stay unchanged (unless the extra include and non-namespaced macros bother you greatly). Specifically, no uses in CPython are updated -- that would just be unnecessary churn. The ``structmember.h`` header is deprecated, though it continues to be available and there are no plans to remove it. Its contents are now available just by including ``Python.h``, with a ``Py`` prefix added if it was missing: - `PyMemberDef`, `PyMember_GetOne` and`PyMember_SetOne` - Type macros like `Py_T_INT`, `Py_T_DOUBLE`, etc. (previously ``T_INT``, ``T_DOUBLE``, etc.) - The flags `Py_READONLY` (previously ``READONLY``) and `Py_AUDIT_READ` (previously all uppercase) Several items are not exposed from ``Python.h``: - `T_OBJECT` (use `Py_T_OBJECT_EX`) - `T_NONE` (previously undocumented, and pretty quirky) - The macro ``WRITE_RESTRICTED`` which does nothing. - The macros ``RESTRICTED`` and ``READ_RESTRICTED``, equivalents of `Py_AUDIT_READ`. - In some configurations, ``<stddef.h>`` is not included from ``Python.h``. It should be included manually when using ``offsetof()``. The deprecated header continues to provide its original contents under the original names. Your old code can stay unchanged, unless the extra include and non-namespaced macros bother you greatly. There is discussion on the issue to rename `T_PYSSIZET` to `PY_T_SSIZE` or similar. I chose not to do that -- users will probably copy/paste that with any spelling, and not renaming it makes migration docs simpler. Co-Authored-By: Alexander Belopolsky <abalkin@users.noreply.github.com> Co-Authored-By: Matthias Braun <MatzeB@users.noreply.github.com>
* gh-98410: move getbufferproc and releasebufferproc to buffer.h (#31158)David Hewitt2022-10-311-0/+2
| | | This adds them to the Limited API.
* gh-98586: Add vector call APIs to the Limited API (GH-98587)Wenzel Jakob2022-10-271-0/+3
| | | Expose the facilities for making vector calls through Python's limited API.
* GH-93503: Add thread-specific APIs to set profiling and tracing functions in ↵Pablo Galindo Salgado2022-08-241-0/+8
| | | | | | | | | | | | | | | | | the C-API (#93504) * gh-93503: Add APIs to set profiling and tracing functions in all threads in the C-API * Use a separate API * Fix NEWS entry * Add locks around the loop * Document ignoring exceptions * Use the new APIs in the sys module * Update docs
* gh-93274: Expose receiving vectorcall in the Limited API (GH-95717)Petr Viktorin2022-08-081-0/+3
|
* gh-60074: add new stable API function PyType_FromMetaclass (GH-93012)Wenzel Jakob2022-05-271-0/+1
| | | | | | | | Added a new stable API function ``PyType_FromMetaclass``, which mirrors the behavior of ``PyType_FromModuleAndSpec`` except that it takes an additional metaclass argument. This is, e.g., useful for language binding tools that need to store additional information in the type object.
* gh-85858: Remove PyUnicode_InternImmortal() function (#92579)Victor Stinner2022-05-131-1/+0
| | | | | | | | | | | | | | | | | Remove the PyUnicode_InternImmortal() function and the SSTATE_INTERNED_IMMORTAL macro. The PyUnicode_InternImmortal() function is still exported in the stable ABI. The function is removed from the API. PyASCIIObject.state.interned size is now a single bit, rather than 2 bits. Keep SSTATE_NOT_INTERNED and SSTATE_INTERNED_MORTAL macros for backward compatibility, but no longer use them internally since the interned member is now a single bit and so can only have two values (interned or not interned). Update stats of _PyUnicode_ClearInterned().
* gh-92536: PEP 623: Remove wstr and legacy APIs from Unicode (GH-92537)Inada Naoki2022-05-121-1/+0
|
* gh-90501: Add PyErr_GetHandledException and PyErr_SetHandledException (GH-30531)Irit Katriel2022-04-151-0/+2
|
* Add feature macro PY_HAVE_THREAD_NATIVE_ID to the stable ABI definition ↵Petr Viktorin2022-04-081-1/+1
| | | | (GH-32365)
* bpo-47115: Document which parts of structs are in limited API/stable ABI ↵Petr Viktorin2022-04-061-881/+885
| | | | | | (GH-32196) Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
* bpo-45459: Add Py_buffer to limited API (GH-29991)Christian Heimes2022-02-021-0/+13
| | | | | | | | | | | - [x] ``Py_buffer`` struct - [x] ``PyBuffer_*()`` API functions - [x] ``PyBUF_*`` constants - [x] ``Py_bf_getbuffer`` and ``Py_bf_releasebuffer`` type slots - [x] ``PyMemoryView_FromBuffer()`` API - [x] tests for limited API - [x] ``make regen-limited-abi`` - [x] documentation update - [ ] export ``PyPickleBuffer*()`` API ???
* bpo-43931: Export Python version as API data (GH-25577)Gabriele N. Tornetta2021-12-101-0/+1
| | | | | When Python is embedded in other applications, it is not easy to determine which version of Python is being used. This change exposes the Python version as part of the API data. Tools like Austin (https://github.com/P403n1x87/austin) can benefit from this data when targeting applications like uWSGI, as the Python version can then be inferred systematically by looking at the exported symbols rather than relying on unreliable pattern matching or other hacks (like remote code execution etc...). Automerge-Triggered-By: GH:pablogsal
* bpo-45292: [PEP 654] add the ExceptionGroup and BaseExceptionGroup classes ↵Irit Katriel2021-10-221-0/+1
| | | | (GH-28569)
* bpo-44220: Export PyStructSequence_UnnamedField in the limited API (GH-26331)Ken Jin2021-10-211-0/+1
|
* bpo-45123: PyAiter_Check and PyObject_GetAiter fix & rename. (GH-28194)Yury Selivanov2021-09-072-6/+6
| | | | | | | | Fix PyAiter_Check to only check for the `__anext__` presense (not for `__aiter__`). Rename `PyAiter_Check()` to `PyAIter_Check()`, `PyObject_GetAiter()` -> `PyObject_GetAIter()`. Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
* bpo-42035: Add PyType_GetQualName() to get a type's qualified name. (GH-27551)Hai Shi2021-08-172-0/+4
|
* bpo-41103: Resurrect the old buffer protocol. (GH-27437)Inada Naoki2021-07-292-0/+22
| | | | | Revert "bpo-41103: Remove old buffer protocol support (#21117)" This reverts commit 6f8a6ee59cb7f99f68df8ee9c3e8c8cf19af3eed.
* bpo-42035: Add a PyType_GetName() to get type's short name. (GH-23903)Hai Shi2021-07-292-0/+4
|
* bpo-40939: Remove documentation for `PyParser_*` & add porting notes (GH-26855)Petr Viktorin2021-06-241-26/+0
| | | | | | I tried to be relatively thorough and give lots of links. One reason is that this wasn't deprecated very long; also it seems people running into this tend to not be familiar with similar APIs. Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
* bpo-44392: Add Py_GenericAlias to C API docs (GH-26724)Ken Jin2021-06-161-1/+1
| | | | Also fix stable ABI type definitions
* bpo-43795: Don't list private names in the limited API (GH-26740)Petr Viktorin2021-06-161-2/+1
| | | | | | | | | | | | | * Remove struct _node from the stable ABI list This struct was removed along with the old parser in Python 3.9 (PEP 617) * Stable ABI list: Use the public name "PyFrameObject" rather than "_frame" * Ensure limited API doesn't contain private names Names prefixed by an underscore are private by definition. * Add a blurb
* bpo-43795: Remove Py_FrozenMain from the Limited API & Stable ABI (GH-26241)Petr Viktorin2021-05-251-1/+0
| | | | | | | | | | | Py_FrozenMain was added to the Limited C API in [bpo-42591]() (3.10.0a4); but to fix that issue it would be enough to add it to the regular C API. The function is undocumented, tests were added very recently ([bpo-44131]()), and most importantly, it is not present in all builds of Python, as the linker sometimes omits it as unused. It should be added back when these issues are fixed. Note that this does not affect Python's regular C API.
* bpo-43795: PEP 652 user documentation (GH-25668)Petr Viktorin2021-05-111-953/+861
| | | | | | - Reformat the C API and ABI Versioning page (and extend/clarify a bit) - Rewrite the stable ABI docs into a general text on C API Compatibility - Add a list of Limited API contents, and notes for the individual items. - Replace `Include/README.rst` with a link to a devguide page with the same info
* bpo-44029: Remove Py_UNICODE APIs (GH-25881)Inada Naoki2021-05-071-84/+0
| | | | | | | | | | | | Remove deprecated `Py_UNICODE` APIs: `PyUnicode_Encode`, `PyUnicode_EncodeUTF7`, `PyUnicode_EncodeUTF8`, `PyUnicode_EncodeUTF16`, `PyUnicode_EncodeUTF32`, `PyUnicode_EncodeLatin1`, `PyUnicode_EncodeMBCS`, `PyUnicode_EncodeDecimal`, `PyUnicode_EncodeRawUnicodeEscape`, `PyUnicode_EncodeCharmap`, `PyUnicode_EncodeUnicodeEscape`, `PyUnicode_TransformDecimalToASCII`, `PyUnicode_TranslateCharmap`, `PyUnicodeEncodeError_Create`, `PyUnicodeTranslateError_Create`. See :pep:`393` and :pep:`624` for reference.
* bpo-43916: Move the _PyStructSequence_InitType function to the internal API ↵Pablo Galindo2021-05-031-1/+0
| | | | (GH-25854)
* bpo-43916: Export the _PyStructSequence_InitType to fix build errors in the ↵Pablo Galindo2021-05-011-0/+1
| | | | curses module (GH-25768)
* bpo-43795: Generate python3dll.c and doc data from manifest (PEP 652) (GH-25315)Petr Viktorin2021-04-291-2/+169
|
* bpo-28254: Add a C-API for controlling the GC state (GH-25687)scoder2021-04-281-0/+3
| | | | | | | | Add new C-API functions to control the state of the garbage collector: PyGC_Enable(), PyGC_Disable(), PyGC_IsEnabled(), corresponding to the functions in the gc module. Co-authored-by: Pablo Galindo <Pablogsal@gmail.com> Co-authored-by: Victor Stinner <vstinner@python.org>
* bpo-43795: PEP-652: Clean up the stable ABI/limited API (GH-25482)Petr Viktorin2021-04-231-6/+1
| | | | | | | | | | | | | | | | | | - `_Py_EncodeLocaleRaw`, which is private by name, undocumented, and wasn't exported in `python3.dll`, is moved to a private header. - `_Py_HashSecret_Initialized`, again private by name, undocumented, and not exported in `python3.dll`, is excluded with `Py_LIMITED_API`. - `PyMarshal_*` and `PyMember_*One` functions, declared in private headers and not exported in `python3.dll`, are removed from `Doc/data/stable_abi.dat`. - `PyMem_Calloc` which *was* exported in `python3dll.c`, is moved to public headers where it joins its other `PyMem_*` friends. Only the last change is documented in the blurb; others are not user-visible. (Nothing uses `Doc/data/stable_abi.dat` yet.) https://bugs.python.org/issue43795
* bpo-43753: Add Py_Is() and Py_IsNone() functions (GH-25227)Victor Stinner2021-04-101-0/+4
| | | | | | | Add the Py_Is(x, y) function to test if the 'x' object is the 'y' object, the same as "x is y" in Python. Add also the Py_IsNone(), Py_IsTrue(), Py_IsFalse() functions to test if an object is, respectively, the None singleton, the True singleton or the False singleton.