summaryrefslogtreecommitdiffstats
path: root/Doc/c-api/init.rst
Commit message (Collapse)AuthorAgeFilesLines
* [3.13] Docs: C API: Fix the incorrect `PyThreadState_Swap` documentation ↵Peter Bierma2025-05-191-2/+3
| | | | (#133900)
* [3.13] gh-133644: update `Py_InteractiveFlag` deprecation notice (GH-133749) ↵Miss Islington (bot)2025-05-091-1/+1
| | | | | | | | (#133752) gh-133644: update `Py_InteractiveFlag` deprecation notice (GH-133749) (cherry picked from commit 3ed8d6fdd1145c48ec7c3e668636cc301de8959e) Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
* [3.13] gh-101100: Docs: Fix some typos in the document (GH-129988) (#129997)Miss Islington (bot)2025-02-111-4/+4
| | | | | | Co-authored-by: Yuki Kobayashi <drsuaimqjgar@gmail.com> Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com> Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
* [3.13] gh-118915: Fix bad link in documentation (GH-129691) (GH-129723)Miss Islington (bot)2025-02-061-1/+1
| | | | | | gh-118915: Fix bad link in documentation (GH-129691) (cherry picked from commit 779d06945cbb59ec187a8c39300fb0ab6f9c0c1d) Co-authored-by: Miro Hrončok <miro@hroncok.cz>
* [3.13] gh-118915: Document `PyUnstable_InterpreterState_GetMainModule` ↵Miss Islington (bot)2025-01-101-0/+11
| | | | | | | (GH-128483) (GH-128677) (cherry picked from commit ea39c8b08d8f025273bfa5b7a95f7b5984dc1e86) Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
* [3.13] gh-127791: Fix, document, and test `PyUnstable_AtExit` (GH-127793) ↵Peter Bierma2024-12-111-0/+9
| | | | | | | | | | (#127819) * Fix merge conflicts. * [3.13] gh-127791: Fix, document, and test `PyUnstable_AtExit` (GH-127793) (cherry picked from commit d5d84c3f13fe7fe591b375c41979d362bc11957a) Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
* [3.13] Fix macro expansions in critical section docs (GH-127226) (#127229)Miss Islington (bot)2024-11-241-2/+2
| | | | | (cherry picked from commit 2bb7846cacb342246aada5ed92d323e54c946063) Co-authored-by: da-woods <dw-git@d-woods.co.uk>
* [3.13] Doc: C API: Fix `Py_NewInterpreterFromConfig` example code ↵Miss Islington (bot)2024-11-231-1/+5
| | | | | | | | (GH-126667) (#127201) Doc: C API: Fix `Py_NewInterpreterFromConfig` example code (GH-126667) (cherry picked from commit e3038e976b25a58f512d8c7083a752c89436eb0d) Co-authored-by: Richard Hansen <rhansen@rhansen.org>
* [3.13] Doc: C API: `PyThreadState::on_delete` was removed in v3.13 ↵Miss Islington (bot)2024-11-201-0/+3
| | | | | | | | (GH-126536) (#127053) Doc: C API: `PyThreadState::on_delete` was removed in v3.13 (GH-126536) (cherry picked from commit 9bca3ef575a088d3330a2743e36423aa5f7bdad8) Co-authored-by: Richard Hansen <rhansen@rhansen.org>
* [3.13] gh-125313: Prefer `sys.base_*` paths in `Py_Get(Exec)Prefix` ↵Miss Islington (bot)2024-10-211-4/+7
| | | | | | | | | | | | deprecation notes (GH-125317) (#125776) gh-125313: Prefer `sys.base_*` paths in `Py_Get(Exec)Prefix` deprecation notes (GH-125317) Prefer `sys.base_*` paths in `Py_Get(Exec)Prefix` deprecation notes. (cherry picked from commit 7d88140d5299bd086434840db66ede8ccd01a688) Signed-off-by: y5c4l3 <y5c4l3@proton.me> Co-authored-by: Y5 <124019959+y5c4l3@users.noreply.github.com>
* [3.13] Doc: Fix typos (GH-125728) (#125773)Miss Islington (bot)2024-10-211-1/+1
| | | | | (cherry picked from commit ded105a62b9d78717f8dc64652e3903190b585dd) Co-authored-by: ember91 <31469580+ember91@users.noreply.github.com>
* [3.13] bpo-34206: Improve docs and test coverage for pre-init functions ↵Alyssa Coghlan2024-10-081-20/+142
| | | | | | | | | | | | | | | | | | | | | | | | (GH-8023) (#125092) - move the Py_Main documentation from the very high level API section to the initialization and finalization section - make it clear that it encapsulates a full Py_Initialize/Finalize cycle of its own - point out that exactly which settings will be read and applied correctly when Py_Main is called after a separate runtime initialization call is version dependent - be explicit that Py_IsInitialized can be called prior to initialization - actually test that Py_IsInitialized can be called prior to initialization - flush stdout in the embedding tests that run code so it appears in the expected order when running with "-vv" - make "-vv" on the subinterpreter embedding tests less spammy --------- (cherry picked from commit 7c4b6a68f263320a2dd19cd5ff63b35c964b1fa8) Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
* [3.13] gh-115145: Update documentation about ``PyThreadState_DeleteCurrent`` ↵Miss Islington (bot)2024-10-031-1/+1
| | | | | | | | (gh-124920) (#124930) gh-115145: Update documentation about ``PyThreadState_DeleteCurrent`` (gh-124920) (cherry picked from commit 9eeb21bf761070649bf8d78976a62dabb6d67a99) Co-authored-by: Donghee Na <donghee.na@python.org>
* [3.13] gh-119344: Make critical section API public (GH-119353) (#120856)Sam Gross2024-06-211-0/+104
| | | | | | | | | | | This makes the following macros public as part of the non-limited C-API for locking a single object or two objects at once. * `Py_BEGIN_CRITICAL_SECTION(op)` / `Py_END_CRITICAL_SECTION()` * `Py_BEGIN_CRITICAL_SECTION2(a, b)` / `Py_END_CRITICAL_SECTION2()` The supporting functions and structs used by the macros are also exposed for cases where C macros are not available. (cherry picked from commit 8f17d69b7bc906e8407095317842cc0fd52cd84a)
* [3.13] gh-120838: Add a Note in the Docs About Expectations for ↵Miss Islington (bot)2024-06-211-3/+10
| | | | | | | Py_Finalize() (gh-120852) (cherry picked from commit 03fa2df92707b543c304a426732214002f81d671, AKA gh-120839) Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
* [3.13] gh-117511: Make PyMutex public in the non-limited API (GH-117731) ↵Sam Gross2024-06-201-0/+43
| | | | | (#120800) (cherry picked from commit 3af7263037de1d0ef63b070fc7bfc2cf042eaebe)
* gh-93502: Add new C-API functions to trace object creation and destruction ↵Pablo Galindo Salgado2024-05-021-0/+52
| | | | (#115945)
* Docs: Fix CVE link (#118077)Jelle Zijlstra2024-04-191-1/+1
|
* gh-117987: Restore several functions removed in Python 3.13 alpha 1 (GH-117993)Victor Stinner2024-04-181-0/+130
| | | | | | | | | Restore these functions removed in Python 3.13 alpha 1: * Py_SetPythonHome() * Py_SetProgramName() * PySys_SetArgvEx() * PySys_SetArgv()
* gh-117929: Restore removed PyEval_InitThreads() function (#117931)Victor Stinner2024-04-171-1/+29
|
* gh-115664: Fix ordering of more versionadded and versionchanged directives ↵Serhiy Storchaka2024-03-071-2/+2
| | | | (GH-116298)
* gh-115172: Fix explicit index extries for the C API (GH-115173)Serhiy Storchaka2024-02-111-14/+11
|
* gh-101100: Properly document frame object attributes (#112735)Alex Waygood2023-12-051-2/+3
|
* gh-110481, doc: Add "immortal" term to the glossary (#112180)Victor Stinner2023-11-171-1/+1
|
* gh-108867: Add PyThreadState_GetUnchecked() function (#108870)Victor Stinner2023-10-031-0/+13
| | | | | | Add PyThreadState_GetUnchecked() function: similar to PyThreadState_Get(), but don't issue a fatal error if it is NULL. The caller is responsible to check if the result is NULL. Previously, this function was private and known as _PyThreadState_UncheckedGet().
* gh-108014: Add Py_IsFinalizing() function (#108032)Victor Stinner2023-08-181-3/+11
| | | Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* gh-107306: Add a Doc Entry for Py_mod_multiple_interpreters (#107403)Eric Snow2023-07-311-0/+1
| | | It was added in 3.12 for PEP 684 (per-interpreter GIL).
* gh-107305: Update the C-API Docs for PEP 684 (gh-107324)Eric Snow2023-07-281-15/+194
|
* gh-107091: Fix some uses of :attr: role (GH-107318)Serhiy Storchaka2023-07-271-2/+5
| | | | Fix also formatting of PyMethodDef members.
* gh-107298: Fix more Sphinx warnings in the C API doc (#107329)Victor Stinner2023-07-271-9/+9
| | | | | | | | | | | | | | | | | | | | | | | Declare the following functions as macros, since they are actually macros. It avoids a warning on "TYPE" or "macro" argument. * PyMem_New() * PyMem_Resize() * PyModule_AddIntMacro() * PyModule_AddStringMacro() * PyObject_GC_New() * PyObject_GC_NewVar() * PyObject_New() * PyObject_NewVar() Add C standard C types to nitpick_ignore in Doc/conf.py: * int64_t * uint64_t * uintptr_t No longer ignore non existing "__int" type in nitpick_ignore. Update Doc/tools/.nitignore
* gh-106919: Use role :c:macro: for referencing the C "constants" (GH-106920)Serhiy Storchaka2023-07-211-31/+31
|
* gh-105373: Remove C API global config vars in Python 3.14 (#106538)Victor Stinner2023-07-071-16/+16
| | | | | Schedule the removal of C API global configuration variables in Python 3.14. Announce the removal to help C extension maintainers to upgrade their code.
* gh-105145: Deprecate Py_GetPath() function (#105179)Victor Stinner2023-06-011-0/+19
| | | | | | | | | | | | | | Deprecate old Python initialization functions: * PySys_ResetWarnOptions() * Py_GetExecPrefix() * Py_GetPath() * Py_GetPrefix() * Py_GetProgramFullPath() * Py_GetProgramName() * Py_GetPythonHome() _tkinter.c uses sys.executable instead of Py_GetProgramName() and uses sys.prefix instead of Py_GetPrefix().
* gh-105182: Remove PyEval_AcquireLock() and PyEval_InitThreads() (#105183)Victor Stinner2023-06-011-74/+1
| | | | | | | | | | | | Remove functions in the C API: * PyEval_AcquireLock() * PyEval_ReleaseLock() * PyEval_InitThreads() * PyEval_ThreadsInitialized() But keep these functions in the stable ABI. Mention "make regen-limited-abi" in "make regen-all".
* gh-105145: Remove old functions to config Python init (#105154)Victor Stinner2023-06-011-224/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove the following old functions to configure the Python initialization, deprecated in Python 3.11: * PySys_AddWarnOptionUnicode() * PySys_AddWarnOption() * PySys_AddXOption() * PySys_HasWarnOptions() * PySys_SetArgvEx() * PySys_SetArgv() * PySys_SetPath() * Py_SetPath() * Py_SetProgramName() * Py_SetPythonHome() * Py_SetStandardStreamEncoding() * _Py_SetProgramFullPath() Most of these functions are kept in the stable ABI, except: * Py_SetStandardStreamEncoding() * _Py_SetProgramFullPath() Update Doc/extending/embedding.rst and Doc/extending/extending.rst to use the new PyConfig API. _testembed.c: * check_stdio_details() now sets stdio_encoding and stdio_errors of PyConfig. * Add definitions of functions removed from the API but kept in the stable ABI. * test_init_from_config() and test_init_read_set() now use PyConfig_SetString() instead of PyConfig_SetBytesString(). Remove _Py_ClearStandardStreamEncoding() internal function.
* GH-97950: Use new-style index directive ('module') (#103996)Adam Turner2023-05-041-7/+7
| | | | | | | | | | | | | | | | | * Use new-style index directive ('module') - C API * Use new-style index directive ('module') - Library * Use new-style index directive ('module') - Reference * Use new-style index directive ('module') - Tutorial * Uncomment module removal in pairindextypes * Use new-style index directive ('module') - C API * Use new-style index directive ('module') - Library * Use new-style index directive ('module') - Reference
* gh-101100: Documenting --prefix and --exec-prefix. (GH-102695)Julien Palard2023-03-151-1/+1
| | | | Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
* Fix typo in `Py_GetPythonHome` signature (#102168)Tanner Firl2023-02-231-1/+1
|
* Fix deprecation doc for `PyEval_InitThreads` (#100667)Alexander Shadchin2023-01-021-2/+2
|
* gh-99377: Revert audit events for thread state creation and free, because ↵Steve Dower2022-11-171-13/+0
| | | | the GIL is not properly held at these times (GH-99543)
* gh-99377: Add audit events for thread creation and clear (GH-99378)Steve Dower2022-11-161-0/+13
|
* Doc: Found some remaining default roles. (GH-98392)Julien Palard2022-10-181-1/+1
|
* Docs: Fix backtick errors found by sphinx-lint (#97998)Hugo van Kemenade2022-10-071-1/+1
| | | Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
* gh-93738: Documentation C syntax (:c:type:<C type> -> :c:expr:<C type>) (#97768)Adam Turner2022-10-051-14/+14
| | | | | :c:type:`<C type>` -> :c:expr:`<C type>` Co-authored-by: Łukasz Langa <lukasz@langa.pl>
* gh-93738: Documentation C syntax (Function glob patterns -> literal markup) ↵Adam Turner2022-10-051-3/+3
| | | | (#97774)
* gh-93738: Documentation C syntax (:c:type:`PyObject` -> :c:expr:`PyObject`) ↵Adam Turner2022-10-041-1/+1
| | | | | (#97776) :c:type:`PyObject` -> :c:expr:`PyObject`
* gh-93738: Documentation C syntax (:c:type:`PyInterpreterState *` -> ↵Adam Turner2022-10-041-1/+1
| | | | | :c:expr:`PyInterpreterState *`) (#97777) :c:type:`PyInterpreterState *` -> :c:expr:`PyInterpreterState *`
* GH-93503: Add thread-specific APIs to set profiling and tracing functions in ↵Pablo Galindo Salgado2022-08-241-0/+24
| | | | | | | | | | | | | | | | | 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-93103: Deprecate global configuration variable (#93104)Victor Stinner2022-05-231-0/+109
| | | | | Deprecate global configuration variables, like Py_IgnoreEnvironmentFlag, in the documentation: the Py_InitializeFromConfig() API should be instead.
* gh-88279: Deprecate PySys_SetArgvEx() (#92363)Victor Stinner2022-05-061-0/+13
| | | | | | | Deprecate the following C functions: * PySys_SetArgv() * PySys_SetArgvEx() * PySys_SetPath()