summaryrefslogtreecommitdiffstats
path: root/Doc/c-api/init.rst
Commit message (Collapse)AuthorAgeFilesLines
...
* bpo-35370: Add _PyEval_SetTrace() function (GH-18975)Victor Stinner2020-03-131-0/+5
| | | | | | | | | * sys.settrace(), sys.setprofile() and _lsprof.Profiler.enable() now properly report PySys_Audit() error if "sys.setprofile" or "sys.settrace" audit event is denied. * Add _PyEval_SetProfile() and _PyEval_SetTrace() function: similar to PyEval_SetProfile() and PyEval_SetTrace() but take a tstate parameter and return -1 on error. * Add _PyObject_FastCallTstate() function.
* bpo-38500: Add _PyInterpreterState_SetEvalFrameFunc() (GH-17340)Victor Stinner2020-03-121-0/+26
| | | | | | | | | | | | PyInterpreterState.eval_frame function now requires a tstate (Python thread state) parameter. Add private functions to the C API to get and set the frame evaluation function: * Add tstate parameter to _PyFrameEvalFunction function type. * Add _PyInterpreterState_GetEvalFrameFunc() and _PyInterpreterState_SetEvalFrameFunc() functions. * Add tstate parameter to _PyEval_EvalFrameDefault().
* bpo-39877: Deprecate PyEval_InitThreads() (GH-18892)Victor Stinner2020-03-101-5/+9
| | | | Deprecated PyEval_InitThreads() and PyEval_ThreadsInitialized(). Calling PyEval_InitThreads() now does nothing.
* bpo-39511: PyThreadState_Clear() calls on_delete (GH-18296)Victor Stinner2020-02-011-0/+4
| | | | | | | | | | | | | | | | | | PyThreadState.on_delete is a callback used to notify Python when a thread completes. _thread._set_sentinel() function creates a lock which is released when the thread completes. It sets on_delete callback to the internal release_sentinel() function. This lock is known as Threading._tstate_lock in the threading module. The release_sentinel() function uses the Python C API. The problem is that on_delete is called late in the Python finalization, when the C API is no longer fully working. The PyThreadState_Clear() function now calls the PyThreadState.on_delete callback. Previously, that happened in PyThreadState_Delete(). The release_sentinel() function is now called when the C API is still fully working.
* bpo-38631: Replace Py_FatalError() with assert() in ceval.c (GH-18279)Victor Stinner2020-01-301-1/+1
| | | | | | | Replace a few Py_FatalError() calls if tstate is NULL with assert(tstate != NULL) in ceval.c. PyEval_AcquireThread(), PyEval_ReleaseThread() and PyEval_RestoreThread() must never be called with a NULL tstate.
* bpo-39161: Document multi-phase init modules under Py_NewInterpreter() ↵Petr Viktorin2020-01-091-17/+35
| | | | | | | | | (GH-17896) \+ this also adds a stronger warning against sharing objects between (sub-)interpreters. https://bugs.python.org/issue39161
* bpo-39136: Fixed typos (GH-17720)Gurupad Hegde2019-12-281-1/+1
| | | | | funtion -> function; configuraton -> configuration; defintitions -> definitions; focusses -> focuses; necesarily -> necessarily; follwing -> following; Excape -> Escape,
* bpo-38816: Add notes in the C-API docs about fork in subinterpreters. (GH-17176)Eric Snow2019-11-151-1/+22
| | | | | | The C-API docs are a bit sparse on the interplay between C `fork()` and the CPython runtime. This change adds some more information on the subject. https://bugs.python.org/issue38816
* bpo-38600: NULL -> ``NULL``. (GH-17001)Serhiy Storchaka2019-10-301-1/+1
| | | Also fix some other formatting.
* bpo-38600: Change the mark up of NULL in the C API documentation. (GH-16950)Serhiy Storchaka2019-10-301-38/+38
| | | | Replace all *NULL* with ``NULL``.
* bpo-38266: Revert bpo-37878: Make PyThreadState_DeleteCurrent() Internal ↵Joannah Nanjekye2019-10-041-0/+8
| | | | | (GH-16558) Revert the removal of PyThreadState_DeleteCurrent() with documentation.
* bpo-38234: Py_SetPath() uses the program full path (GH-16357)Victor Stinner2019-09-241-2/+6
| | | | | | | Py_SetPath() now sets sys.executable to the program full path (Py_GetProgramFullPath()), rather than to the program name (Py_GetProgramName()). Fix also memory leaks in pathconfig_set_from_config().
* bpo-37363: Document internal audit events (GH-14663)Christian Heimes2019-09-121-1/+6
| | | | | | | | | Three internal cpython events were not documented, yet. Signed-off-by: Christian Heimes <christian@python.org> https://bugs.python.org/issue37363
* bpo-36763, doc: Add links in the new C API init doc (GH-15433)Victor Stinner2019-08-231-0/+2
|
* bpo-36487: Make C-API docs clear about what the main interpreter is. (gh-12666)Joannah Nanjekye2019-08-021-4/+12
|
* Doc: Replace the deprecated highlightlang directive by highlight. (#13377)Stéphane Wirtel2019-05-171-1/+1
| | | | highlightlang is deprecated since April 2018 in Sphinx. See https://github.com/sphinx-doc/sphinx/pull/4845
* bpo-36728: Remove PyEval_ReInitThreads documentation (GH-13282)Victor Stinner2019-05-131-7/+0
|
* bpo-36475: Finalize PyEval_AcquireLock() and PyEval_AcquireThread() properly ↵Joannah Nanjekye2019-04-291-0/+24
| | | | | | | | (GH-12667) PyEval_AcquireLock() and PyEval_AcquireThread() now terminate the current thread if called while the interpreter is finalizing, making them consistent with PyEval_RestoreThread(), Py_END_ALLOW_THREADS, and PyGILState_Ensure().
* bpo-36427: Document that PyEval_RestoreThread and PyGILState_Ensure can ↵Pablo Galindo2019-04-131-0/+12
| | | | | | | | terminate the calling thread (GH-12541) Calling these function from a thread when the runtime is finalizing will terminate the thread, even if the thread was not created by Python. Users can use _Py_IsFinalizing or sys.is_finalizing to check if the interpreter is in the process of being finalized before calling this function to avoid unwanted termination.
* bpo-36157:Document PyInterpreterState_Main() (GH-12238)Joannah Nanjekye2019-04-011-0/+5
| | | | | | | I have added documentation for `PyInterpreterState_Main()`. I chose to place it under Advanced Debugger Support together with similar functions like `PyInterpreterState_Head()`, `PyInterpreterState_Next(`), and `PyInterpreterState_ThreadHead()` . https://bugs.python.org/issue36157
* C API docs: Py_IsInitialized is always safe to call (GH-12630)Nick Coghlan2019-03-301-0/+1
|
* bpo-36124: Add PyInterpreterState.dict. (gh-12132)Eric Snow2019-03-151-0/+12
|
* bpo-11233: Create availability directive for documentation (GH-9692)Cheryl Sabella2018-10-121-2/+2
| | | | | | Replace "Availability: xxx" with ".. availability:: xxx" in the doc. Original patch by Georg Brandl. Co-Authored-By: Georg Brandl <georg@python.org>
* bpo-31370: Remove references to threadless builds (#8805)Zackery Spytz2018-09-291-8/+8
| | | Support for threadless builds was removed in a6a4dc81.
* bpo-33042: Fix pre-initialization sys module configuration (GH-6157)Nick Coghlan2018-03-251-0/+3
| | | | | | | | | - new test case for pre-initialization of sys.warnoptions and sys._xoptions - restored ability to call these APIs prior to Py_Initialize - updated the docs for the affected APIs to make it clear they can be called before Py_Initialize - also enhanced the existing embedding test cases to check for expected settings in the sys module
* Make formatting of some return codes conforming to the general style. (#5587)Serhiy Storchaka2018-02-091-3/+3
|
* bpo-20891: Py_Initialize() now creates the GIL (#4700)Victor Stinner2018-01-291-40/+23
| | | | The GIL is no longer created "on demand" to fix a race condition when PyGILState_Ensure() is called in a non-Python thread.
* Fix PyTrace_RETURN documentation (GH-5384)Xiang Zhang2018-01-281-1/+1
| | | It will be triggered when propagating an exception.
* bpo-32649: Add C API docs for per-opcode tracing & profiling (GH-5360)Xiang Zhang2018-01-281-9/+20
| | | | Updating the C API docs was missed when the per-opcode tracing & profiling support was initially added.
* bpo-32687: Fix wrong meaning of args for PyTrace_LINE/CALL in documentation ↵Xiang Zhang2018-01-281-2/+2
| | | | | | (#5361)
* bpo-17799: Explain real behaviour of sys.settrace and sys.setprofile (#4056)Pablo Galindo2018-01-241-5/+6
|
* bpo-32241: Add the const qualifire to declarations of umodifiable strings. ↵Serhiy Storchaka2017-12-121-2/+2
| | | | (#4748)
* Revert "bpo-32197: Try to fix a compiler error on OS X introduced in ↵Victor Stinner2017-12-041-3/+2
| | | | | | | | | | | | | | | | | | | | | | | bpo-32030. (#4681)" (#4694) * Revert "bpo-32197: Try to fix a compiler error on OS X introduced in bpo-32030. (#4681)" This reverts commit 13badcbc60cdbfae1dba1683fd2fae9d70717143. Re-apply commits: * "bpo-32030: _PyPathConfig_Init() sets home and program_name (#4673)" commit af5a895073c24637c094772b27526b94a12ec897. * "bpo-32030: Fix config_get_program_name() on macOS (#4669)" commit e23c06e2b03452c9aaf0dae52296c85e572f9bcd. * "bpo-32030: Add Python/pathconfig.c (#4668)" commit 0ea395ae964c9cd0f499e2ef0d0030c971201220. * "bpo-32030: Don't call _PyPathConfig_Fini() in Py_FinalizeEx() (#4667)" commit ebac19dad6263141d5db0a2c923efe049dba99d2. * "bpo-32030: Fix Py_GetPath(): init program_name (#4665)" commit 9ac3d8882712c9675c3d2f9f84af6b5729575cde. * Fix compilation error on macOS
* bpo-32197: Try to fix a compiler error on OS X introduced in bpo-32030. (#4681)Serhiy Storchaka2017-12-021-2/+3
| | | | | | | | | | | | | | | | | | | | | | * Revert "bpo-32030: _PyPathConfig_Init() sets home and program_name (#4673)" This reverts commit af5a895073c24637c094772b27526b94a12ec897. * Revert "bpo-32030: Fix config_get_program_name() on macOS (#4669)" This reverts commit e23c06e2b03452c9aaf0dae52296c85e572f9bcd. * Revert "bpo-32030: Add Python/pathconfig.c (#4668)" This reverts commit 0ea395ae964c9cd0f499e2ef0d0030c971201220. * Revert "bpo-32030: Don't call _PyPathConfig_Fini() in Py_FinalizeEx() (#4667)" This reverts commit ebac19dad6263141d5db0a2c923efe049dba99d2. * Revert "bpo-32030: Fix Py_GetPath(): init program_name (#4665)" This reverts commit 9ac3d8882712c9675c3d2f9f84af6b5729575cde.
* bpo-32030: _PyPathConfig_Init() sets home and program_name (#4673)Victor Stinner2017-12-021-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | _PyPathConfig_Init() now also initialize home and program_name: * Rename existing _PyPathConfig_Init() to _PyPathConfig_Calculate(). Add a new _PyPathConfig_Init() function in pathconfig.c which handles the _Py_path_config variable and call _PyPathConfig_Calculate(). * Add home and program_name fields to _PyPathConfig.home * _PyPathConfig_Init() now initialize home and program_name from main_config * Py_SetProgramName(), Py_SetPythonHome() and Py_GetPythonHome() now calls Py_FatalError() on failure, instead of silently ignoring failures. * config_init_home() now gets directly _Py_path_config.home to only get the value set by Py_SetPythonHome(), or NULL if Py_SetPythonHome() was not called. * config_get_program_name() now gets directly _Py_path_config.program_name to only get the value set by Py_SetProgramName(), or NULL if Py_SetProgramName() was not called. * pymain_init_python() doesn't call Py_SetProgramName() anymore, _PyPathConfig_Init() now always sets the program name * Call _PyMainInterpreterConfig_Read() in pymain_parse_cmdline_envvars_impl() to control the memory allocator * C API documentation: it's no more safe to call Py_GetProgramName() before Py_Initialize().
* bpo-20891: Fix PyGILState_Ensure() (#4650)Victor Stinner2017-11-301-2/+3
| | | | | | | When PyGILState_Ensure() is called in a non-Python thread before PyEval_InitThreads(), only call PyEval_InitThreads() after calling PyThreadState_New() to fix a crash. Add an unit test in test_embed.
* bpo-32124: Document C functions safe before init (#4540)Victor Stinner2017-11-241-3/+212
| | | | Explicitly document C functions and C variables that can be set before Py_Initialize().
* Fix wording about Py_tss_NEEDS_INIT in docs (GH-4096)Masayuki Yamamoto2017-10-241-1/+1
| | | | Make more sense to replace the word "default value" with "initializer" for Py_tss_NEEDS_INIT.
* bpo-25658: Implement PEP 539 for Thread Specific Storage (TSS) API (GH-1362)Masayuki Yamamoto2017-10-061-0/+157
| | | | | | | | | See PEP 539 for details. Highlights of changes: - Add Thread Specific Storage (TSS) API - Document the Thread Local Storage (TLS) API as deprecated - Update code that used TLS API to use TSS API
* Doc nits for bpo-16500 (#1841)Antoine Pitrou2017-05-281-4/+4
| | | | | | * Doc nits for bpo-16500 * Fix more references
* bpo-29102: Add a unique ID to PyInterpreterState. (#1639)Eric Snow2017-05-231-0/+8
|
* bpo-6532: Make the thread id an unsigned integer. (#781)Serhiy Storchaka2017-03-231-1/+4
| | | | | | | | | | | * bpo-6532: Make the thread id an unsigned integer. From C API side the type of results of PyThread_start_new_thread() and PyThread_get_thread_ident(), the id parameter of PyThreadState_SetAsyncExc(), and the thread_id field of PyThreadState changed from "long" to "unsigned long". * Restore a check in thread_get_ident().
* Remove CALL_PROFILE special buildVictor Stinner2016-11-281-40/+0
| | | | | | | | | | | Issue #28799: * Remove the PyEval_GetCallStats() function. * Deprecate the untested and undocumented sys.callstats() function. * Remove the CALL_PROFILE special build Use the sys.setprofile() function, cProfile or profile module to profile function calls.
* Issue #28496: Mark up constants 0, 1 and -1 that denote return values orSerhiy Storchaka2016-10-271-12/+12
|\ | | | | | | special input values as literal text.
| * Issue #28496: Mark up constants 0, 1 and -1 that denote return values orSerhiy Storchaka2016-10-271-12/+12
| | | | | | | | special input values as literal text.
* | Closes #22731: Documents change of console mode.Steve Dower2016-09-091-0/+4
|\ \ | |/
| * Closes #22731: Documents change of console mode.Steve Dower2016-09-091-0/+4
| |
* | Issue #26736: Used HTTPS for external links in the documentation if possible.Serhiy Storchaka2016-05-071-1/+1
|\ \ | |/
| * Issue #26736: Used HTTPS for external links in the documentation if possible.Serhiy Storchaka2016-05-071-1/+1
| |
* | Issue #5319: New Py_FinalizeEx() API to exit with status 120 on failureMartin Panter2015-11-301-12/+21
|/