summaryrefslogtreecommitdiffstats
path: root/Doc/c-api/sys.rst
Commit message (Collapse)AuthorAgeFilesLines
* [3.12] gh-101100: Clean up Doc/c-api/exceptions.rst and Doc/c-api/sys.rst ↵Miss Islington (bot)2024-02-111-11/+21
| | | | | | | | (GH-114825) (GH-115308) (cherry picked from commit e1552fd19de17e7a6daa3c2a6d1ca207bb8eaf8e) Co-authored-by: Skip Montanaro <skip.montanaro@gmail.com>
* [3.12] gh-115172: Fix explicit index extries for the C API (GH-115173) ↵Serhiy Storchaka2024-02-111-4/+4
| | | | | (GH-115292) (cherry picked from commit 573acb30f22a84c0f2c951efa002c9946e29b6a3)
* [3.12] gh-98154: Clarify Usage of "Reference Count" In the Docs (gh-107552) ↵Miss Islington (bot)2023-08-081-2/+3
| | | | | | | | | | | | | | | | | | (#107752) * gh-98154: Clarify Usage of "Reference Count" In the Docs (gh-107552) PEP 683 (immortal objects) revealed some ways in which the Python documentation has been unnecessarily coupled to the implementation details of reference counts. In the end users should focus on reference ownership, including taking references and releasing them, rather than on how many reference counts an object has. This change updates the documentation to reflect that perspective. It also updates the docs relative to immortal objects in a handful of places. (cherry picked from commit 5dc825d504ad08d64c9d1ce578f9deebbe012604) Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com> * Fix a typo. --------- Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
* [3.12] gh-107298: Fix yet more Sphinx warnings in the C API doc (GH-107345) ↵Serhiy Storchaka2023-07-281-2/+2
| | | | | (GH-107380) (cherry picked from commit 983305268e2291b0a7835621b81bf40cba7c27f3)
* [3.12] gh-107298: Fix more Sphinx warnings in the C API doc (GH-107329) ↵Serhiy Storchaka2023-07-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | (GH-107376) 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. (cherry picked from commit 8d61a71f9c81619e34d4a30b625922ebc83c561b) Co-authored-by: Victor Stinner <vstinner@python.org>
* [3.12] gh-106948: Docs: Disable links for C standard library functions, OS ↵Miss Islington (bot)2023-07-231-2/+2
| | | | | | | | utility functions and system calls (GH-107062) (#107154) (cherry picked from commit b447e19e720e6781025432a40eb72b1cc93ac944) Co-authored-by: Erlend E. Aasland <erlend@python.org> Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.12] gh-106919: Use role :c:macro: for referencing the C "constants" ↵Serhiy Storchaka2023-07-211-2/+2
| | | | | (GH-106920) (GH-106951) (cherry picked from commit fcc816dbff7ca66c26f57a506e4d2330fe41d0ff)
* gh-93738: Documentation C syntax (:c:type:<C type> -> :c:expr:<C type>) (#97768)Adam Turner2022-10-051-3/+3
| | | | | :c:type:`<C type>` -> :c:expr:`<C type>` Co-authored-by: Łukasz Langa <lukasz@langa.pl>
* gh-93103: Doc uses PyConfig rather than deprecated vars (#96070)Victor Stinner2022-08-181-2/+2
| | | | The C API documentation now uses the new PyConfig API, rather than deprecated global configuration variables.
* gh-77782: Py_FdIsInteractive() now uses PyConfig.interactive (#93916)Victor Stinner2022-06-171-1/+3
|
* Document Py_ssize_t. (GH-92512)Julien Palard2022-05-131-2/+2
| | | | | | It fixes 252 errors from a Sphinx nitpicky run (sphinx-build -n). But there's 8182 errors left. Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
* gh-88279: Deprecate PySys_SetArgvEx() (#92363)Victor Stinner2022-05-061-0/+7
| | | | | | | Deprecate the following C functions: * PySys_SetArgv() * PySys_SetArgvEx() * PySys_SetPath()
* Docs: Clarify availability of PyOS_CheckStack (GH-91816)Petr Viktorin2022-04-221-3/+3
|
* More minor fixes to C API docs (GH-31525)Jelle Zijlstra2022-04-021-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | * wording fixes in type.rst * grammar and punctuation in sys.rst * set: grammar fixes * structures: capitalization fix * grammar fixes for sequence * objects: point to Py_TYPE instead of direct object access * numbers: add more explicit Python equivalences * method: add missing period * memory: grammar fix * mapping: grammar fixes * long: grammar fix * iter: fix grammar for PyAIter_Check * init: grammar fix
* bpo-44113: Deprecate old functions to config Python init (GH-26060)Victor Stinner2021-05-121-0/+18
| | | | | | | | | | | | | | | | | Deprecate the following functions to configure the Python initialization: * PySys_AddWarnOption() * PySys_AddWarnOptionUnicode() * PySys_AddXOption() * PySys_HasWarnOptions() * Py_SetPath() * Py_SetProgramName() * Py_SetPythonHome() * Py_SetStandardStreamEncoding() * _Py_SetProgramFullPath() Use the new PyConfig API of the Python Initialization Configuration instead (PEP 587).
* bpo-42236: Enhance init and encoding documentation (GH-23109)Victor Stinner2020-11-021-34/+36
| | | | | | | | | | | | | | | | | | | | | Enhance the documentation of the Python startup, filesystem encoding and error handling, locale encoding. Add a new "Python UTF-8 Mode" section. * Add "locale encoding" and "filesystem encoding and error handler" to the glossary * Remove documentation from Include/cpython/initconfig.h: move it to Doc/c-api/init_config.rst. * Doc/c-api/init_config.rst: * Document command line options and environment variables * Document default values. * Add a new "Python UTF-8 Mode" section in Doc/library/os.rst. * Add warnings to Py_DecodeLocale() and Py_EncodeLocale() docs. * Document how Python selects the filesystem encoding and error handler at a single place: PyConfig.filesystem_encoding and PyConfig.filesystem_errors. * PyConfig: move orig_argv member at the right place.
* bpo-39882: Py_FatalError() logs the function name (GH-18819)Victor Stinner2020-03-061-0/+7
| | | | | | | | | | | | The Py_FatalError() function is replaced with a macro which logs automatically the name of the current function, unless the Py_LIMITED_API macro is defined. Changes: * Add _Py_FatalErrorFunc() function. * Remove the function name from the message of Py_FatalError() calls which included the function name. * Update tests.
* bpo-39008: Require Py_ssize_t for PySys_Audit formats rather than raise a ↵Steve Dower2019-12-091-0/+8
| | | | deprecation warning (GH-17540)
* bpo-38892: Improve docs for audit event (GH-17361)Terry Jan Reedy2019-11-261-11/+12
|
* bpo-38816: Add notes in the C-API docs about fork in subinterpreters. (GH-17176)Eric Snow2019-11-151-0/+18
| | | | | | 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: Change the mark up of NULL in the C API documentation. (GH-16950)Serhiy Storchaka2019-10-301-4/+4
| | | | Replace all *NULL* with ``NULL``.
* bpo-38434: Fixes some audit event documentation (GH-16932)Steve Dower2019-10-261-1/+10
|
* bpo-37390: Add audit event table to documentations (GH-14406)Steve Dower2019-06-271-4/+0
| | | Also updates some (unreleased) event names to be consistent with the others.
* Fix typo: decription -> description (GH-13543)Xtreak2019-05-241-1/+1
|
* bpo-36842: Implement PEP 578 (GH-12613)Steve Dower2019-05-231-0/+50
| | | Adds sys.audit, sys.addaudithook, io.open_code, and associated C APIs.
* 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-31904: Add encoding support for VxWorks RTOS (GH-12051)pxinwr2019-03-041-2/+2
| | | | | | | | Use UTF-8 as the system encoding on VxWorks. The main reason are: 1. The locale is frequently misconfigured. 2. Missing some functions to deal with locale in VxWorks C library.
* bpo-34523: Py_DecodeLocale() use UTF-8 on Windows (GH-8998)Victor Stinner2018-08-291-4/+11
| | | | | | | Py_DecodeLocale() and Py_EncodeLocale() now use the UTF-8 encoding on Windows if Py_LegacyWindowsFSEncodingFlag is zero. pymain_read_conf() now sets Py_LegacyWindowsFSEncodingFlag in its loop, but restore its value at exit.
* bpo-33042: Fix pre-initialization sys module configuration (GH-6157)Nick Coghlan2018-03-251-3/+12
| | | | | | | | | - 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
* bpo-29240: Fix locale encodings in UTF-8 Mode (#5170)Victor Stinner2018-01-151-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | Modify locale.localeconv(), time.tzname, os.strerror() and other functions to ignore the UTF-8 Mode: always use the current locale encoding. Changes: * Add _Py_DecodeLocaleEx() and _Py_EncodeLocaleEx(). On decoding or encoding error, they return the position of the error and an error message which are used to raise Unicode errors in PyUnicode_DecodeLocale() and PyUnicode_EncodeLocale(). * Replace _Py_DecodeCurrentLocale() with _Py_DecodeLocaleEx(). * PyUnicode_DecodeLocale() now uses _Py_DecodeLocaleEx() for all cases, especially for the strict error handler. * Add _Py_DecodeUTF8Ex(): return more information on decoding error and supports the strict error handler. * Rename _Py_EncodeUTF8_surrogateescape() to _Py_EncodeUTF8Ex(). * Replace _Py_EncodeCurrentLocale() with _Py_EncodeLocaleEx(). * Ignore the UTF-8 mode to encode/decode localeconv(), strerror() and time zone name. * Remove PyUnicode_DecodeLocale(), PyUnicode_DecodeLocaleAndSize() and PyUnicode_EncodeLocale() now ignore the UTF-8 mode: always use the "current" locale. * Remove _PyUnicode_DecodeCurrentLocale(), _PyUnicode_DecodeCurrentLocaleAndSize() and _PyUnicode_EncodeCurrentLocale().
* bpo-29240: PEP 540: Add a new UTF-8 Mode (#855)Victor Stinner2017-12-131-2/+11
| | | | | | | | | | | | | | | | | | | | | | * Add -X utf8 command line option, PYTHONUTF8 environment variable and a new sys.flags.utf8_mode flag. * If the LC_CTYPE locale is "C" at startup: enable automatically the UTF-8 mode. * Add _winapi.GetACP(). encodings._alias_mbcs() now calls _winapi.GetACP() to get the ANSI code page * locale.getpreferredencoding() now returns 'UTF-8' in the UTF-8 mode. As a side effect, open() now uses the UTF-8 encoding by default in this mode. * Py_DecodeLocale() and Py_EncodeLocale() now use the UTF-8 encoding in the UTF-8 Mode. * Update subprocess._args_from_interpreter_flags() to handle -X utf8 * Skip some tests relying on the current locale if the UTF-8 mode is enabled. * Add test_utf8mode.py. * _Py_DecodeUTF8_surrogateescape() gets a new optional parameter to return also the length (number of wide characters). * pymain_get_global_config() and pymain_set_global_config() now always copy flag values, rather than only copying if the new value is greater than the old value.
* bpo-16500: Don't use string constants for os.register_at_fork() behavior (#1834)Gregory P. Smith2017-05-291-3/+4
| | | | Instead use keyword only arguments to os.register_at_fork for each of the scenarios. Updates the documentation for clarity.
* bpo-16500: Allow registering at-fork handlers (#1715)Antoine Pitrou2017-05-271-0/+39
| | | | | | | | | | | | * bpo-16500: Allow registering at-fork handlers * Address Serhiy's comments * Add doc for new C API * Add doc for new Python-facing function * Add NEWS entry + doc nit
* bpo-29918: Add missed "const" modifiers in C API documentation. (#846)Serhiy Storchaka2017-03-301-2/+2
|
* Issue #27186: Update os.fspath()/PyOS_FSPath() to check the returnBrett Cannon2016-06-241-2/+3
| | | | | | | type of __fspath__(). As part of this change, also make sure that the pure Python implementation of os.fspath() is tested.
* Issue #27186: Document PyOS_FSPath().Brett Cannon2016-06-091-0/+10
|
* Issue #5319: New Py_FinalizeEx() API to exit with status 120 on failureMartin Panter2015-11-301-5/+9
|
* Fixed documentation of functions with const char* arguments.Serhiy Storchaka2015-06-211-2/+2
|\
| * Fixed documentation of functions with const char* arguments.Serhiy Storchaka2015-06-211-2/+2
| |
* | Issue #18395: Rename ``_Py_char2wchar()`` to :c:func:`Py_DecodeLocale`, renameVictor Stinner2014-08-011-0/+54
|/ | | | | ``_Py_wchar2char()`` to :c:func:`Py_EncodeLocale`, and document these functions.
* Remove already dropped function PySys_GetFile from documentation.Andrew Svetlov2012-10-311-6/+0
| | | | Thanks to Daniel Müllner from docs@
* Issue #10089: Add support for arbitrary -X options on the command-line.Antoine Pitrou2010-10-211-0/+15
| | | | They can be retrieved through a new attribute `sys._xoptions`.
* Migrate to Sphinx 1.0 C language constructs.Georg Brandl2010-10-061-34/+34
|
* Consistency check for versionadded/changed directives.Georg Brandl2010-08-171-0/+1
|
* Add versionadded tag to PySys_FormatStd*() functions docVictor Stinner2010-08-161-0/+4
|
* Issue #9599: Create PySys_FormatStdout() and PySys_FormatStderr()Victor Stinner2010-08-161-1/+12
| | | | | Write a message formatted by PyUnicode_FromFormatV() to sys.stdout and sys.stderr.
* Issue #8589: Decode PYTHONWARNINGS environment variable with the file systemVictor Stinner2010-05-191-0/+4
| | | | | encoding and surrogateespace error handler instead of the locale encoding to be consistent with os.environ. Add PySys_AddWarnOptionUnicode() function.
* Merged revisions ↵Alexandre Vassalotti2009-07-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 74074,74077,74111,74188,74192-74193,74200,74252-74253,74258-74261 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r74074 | georg.brandl | 2009-07-18 05:03:10 -0400 (Sat, 18 Jul 2009) | 1 line #6513: fix example code: warning categories are classes, not instances. ........ r74077 | georg.brandl | 2009-07-18 05:43:40 -0400 (Sat, 18 Jul 2009) | 1 line #6489: fix an ambiguity in getiterator() documentation. ........ r74111 | benjamin.peterson | 2009-07-20 09:30:10 -0400 (Mon, 20 Jul 2009) | 1 line remove docs for deprecated -p option ........ r74188 | benjamin.peterson | 2009-07-23 10:25:31 -0400 (Thu, 23 Jul 2009) | 1 line use bools ........ r74192 | georg.brandl | 2009-07-24 12:28:38 -0400 (Fri, 24 Jul 2009) | 1 line Fix arg types of et#. ........ r74193 | georg.brandl | 2009-07-24 12:46:38 -0400 (Fri, 24 Jul 2009) | 1 line Dont put "void" in signature for nullary functions. ........ r74200 | georg.brandl | 2009-07-25 09:02:15 -0400 (Sat, 25 Jul 2009) | 1 line #6571: add index entries for more operators. ........ r74252 | georg.brandl | 2009-07-29 12:06:31 -0400 (Wed, 29 Jul 2009) | 1 line #6593: fix link targets. ........ r74253 | georg.brandl | 2009-07-29 12:09:17 -0400 (Wed, 29 Jul 2009) | 1 line #6591: add reference to ioctl in fcntl module for platforms other than Windows. ........ r74258 | georg.brandl | 2009-07-29 12:57:05 -0400 (Wed, 29 Jul 2009) | 1 line Add a link to readline, and mention IPython and bpython. ........ r74259 | georg.brandl | 2009-07-29 13:07:21 -0400 (Wed, 29 Jul 2009) | 1 line Fix some markup and small factual glitches found by M. Markert. ........ r74260 | georg.brandl | 2009-07-29 13:15:20 -0400 (Wed, 29 Jul 2009) | 1 line Fix a few markup glitches. ........ r74261 | georg.brandl | 2009-07-29 13:50:25 -0400 (Wed, 29 Jul 2009) | 1 line Rewrite the section about classes a bit; mostly tidbits, and a larger update to the section about "private" variables to reflect the Pythonic consensus better. ........
* Merged revisions 68203 via svnmerge fromMartin v. Löwis2009-01-031-7/+0
| | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r68203 | martin.v.loewis | 2009-01-03 18:19:26 +0100 (Sa, 03 Jan 2009) | 2 lines Issue #4817: Remove unused function PyOS_GetLastModificationTime. ........
* Change command line processing API to use wchar_t.Martin v. Löwis2008-04-051-2/+2
| | | | Fixes #2128.