summaryrefslogtreecommitdiffstats
path: root/Doc/c-api/init.rst
Commit message (Collapse)AuthorAgeFilesLines
* [3.7] bpo-38600: NULL -> ``NULL``. (GH-17001) (GH-17004)Serhiy Storchaka2019-10-301-1/+1
| | | | | Also fix some other formatting. (cherry picked from commit e835b31d2b212c3c7820364398979cae2a9740b2)
* [3.7] bpo-38600: Change the mark up of NULL in the C API documentation. ↵Serhiy Storchaka2019-10-301-37/+37
| | | | | | | (GH-16950) (GH-17000) Replace all *NULL* with ``NULL``. (cherry picked from commit 25fc088607c855060ed142296dc1bd0125fad1af)
* [3.7] bpo-36427: Document that PyEval_RestoreThread and PyGILState_Ensure ↵Pablo Galindo2019-04-141-0/+12
| | | | | | | | | can terminate the calling thread (GH-12541) (GH-12820) 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. (cherry picked from commit fde9b33)
* bpo-36157:Document PyInterpreterState_Main() (GH-12238)Miss Islington (bot)2019-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 (cherry picked from commit 8c61739defd88c7f79e86537886c33745843ce01) Co-authored-by: Joannah Nanjekye <33177550+nanjekyejoannah@users.noreply.github.com>
* C API docs: Py_IsInitialized is always safe to call (GH-12630)Miss Islington (bot)2019-03-301-0/+1
| | | | | (cherry picked from commit ddbb978e1065dde21d1662386b26ded359f4b16e) Co-authored-by: Nick Coghlan <ncoghlan@gmail.com>
* [3.7] bpo-11233: Create availability directive for documentation (GH-9692) ↵Cheryl Sabella2018-10-151-2/+2
| | | | | | | | | | | (GH-9830) Replace "Availability: xxx" with ".. availability:: xxx" in the doc. Original patch by Georg Brandl. Co-Authored-By: Georg Brandl <georg@python.org> (cherry picked from commit 2d6097d027e0dd3debbabc702aa9c98d94ba32a3) Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
* bpo-33042: Fix pre-initialization sys module configuration (GH-6157)Miss Islington (bot)2018-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 (cherry picked from commit bc77eff8b96be4f035e665ab35c1d06e22f46491) Co-authored-by: Nick Coghlan <ncoghlan@gmail.com>
* Make formatting of some return codes conforming to the general style. ↵Miss Islington (bot)2018-02-091-3/+3
| | | | | | | (GH-5587) (GH-5597) (cherry picked from commit 5bb0005f9ff768ac443924b4bb26c3818ce8dc5a) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* 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
|/
* Close #24458: PEP 489 documentationNick Coghlan2015-07-031-0/+2
| | | | Patch by Petr Viktorin.
* Fixed documentation of functions with const char* arguments.Serhiy Storchaka2015-06-211-1/+1
|\
| * Fixed documentation of functions with const char* arguments.Serhiy Storchaka2015-06-211-1/+1
| |
* | merge 3.4 (#23221)Benjamin Peterson2015-01-131-1/+1
|\ \ | |/
| * fix instances of consecutive articles (closes #23221)Benjamin Peterson2015-01-131-1/+1
| | | | | | | | Patch by Karan Goel.
* | merge 3.4 (#23110)Benjamin Peterson2014-12-241-0/+3
|\ \ | |/
| * doucment that Py_SetPath copies its argument (closes #23110)Benjamin Peterson2014-12-241-0/+3
| |
* | merge with 3.4Georg Brandl2014-10-111-1/+3
|\ \ | |/
| * Closes #21687: delimiter in Py_SetPath is platform dependentGeorg Brandl2014-10-111-1/+3
| |
| * Merge in all documentation changes since branching 3.4.0rc1.Larry Hastings2014-03-161-0/+1
| |
* | Issue #18395, #22108: Update embedded Python examples to decode correctlyVictor Stinner2014-08-011-0/+15
| | | | | | | | command line parameters: use Py_DecodeLocale() and PyUnicode_DecodeFSDefault().
* | Merge 3.3 (#16805)Éric Araujo2014-03-121-0/+1
|\ \ | |/ |/|
| * Fix note markup (#16805).Éric Araujo2014-03-121-0/+1
| | | | | | | | Patch by Tshepang Lekhonkhobe, reviewed by Georg Brandl.
* | Issue #16129: Py_SetStandardStreamEncoding cleanupsNick Coghlan2013-10-181-5/+8
| | | | | | | | | | | | | | | | | | - don't call PyErr_NoMemory with interpreter is not initialised - note that it's OK to call _PyMem_RawStrDup here - don't include this in the limited API - capitalise "IO" - be explicit that a non-zero return indicates an error - include versionadded marker in docs
* | Issue #16129: Add `Py_SetStandardStreamEncoding`Nick Coghlan2013-10-171-0/+27
| | | | | | | | | | | | | | | | | | | | | | This new pre-initialization API allows embedding applications like Blender to force a particular encoding and error handler for the standard IO streams. Also refactors Modules/_testembed.c to let us start testing multiple embedding scenarios. (Initial patch by Bastien Montagne)
* | Add a "skull and crossbones" to Py_AddPendingCall.Antoine Pitrou2013-09-301-25/+30
|\ \ | |/
| * Add a "skull and crossbones" to Py_AddPendingCall.Antoine Pitrou2013-09-301-25/+30
| |
* | Issue #16400: Add command line option for isolated mode.Christian Heimes2013-08-101-1/+5
| | | | | | | | | | | | | | | | | | | | -I Run Python in isolated mode. This also implies -E and -s. In isolated mode sys.path contains neither the script’s directory nor the user’s site-packages directory. All PYTHON* environment variables are ignored, too. Further restrictions may be imposed to prevent the user from injecting malicious code.