summaryrefslogtreecommitdiffstats
path: root/Doc/library/sys.rst
Commit message (Collapse)AuthorAgeFilesLines
* bpo-41192: Clarify the sys module's description of the auditing feature ↵Miss Skeleton (bot)2020-10-201-10/+25
| | | | | | | | | | (GH-22820) Co-authored-by: Éric Araujo <merwok@netwok.org> (cherry picked from commit 0c37269be7065b9b15b7b3a4406084f9535a793a) Co-authored-by: Andrew Kuchling <amk@amk.ca> Co-authored-by: Andrew Kuchling <amk@amk.ca>
* Doc: sys.__unraisablehook__ and bytearray.hex separators are new in 3.8 ↵Miss Islington (bot)2020-02-081-0/+2
| | | | | | | | | | | (GH-17884) Minor fix in documentation: - `sys.__unraisablehook__` is new in version 3.8 - Optional `sep` and `bytes_per_sep` parameters for `bytearray.hex` is also supported in Python 3.8 (just like `bytes.hex`) (cherry picked from commit 0edc2c7678266c39a7ceb2df885cb050f887e32b) Co-authored-by: Saiyang Gou <gousaiyang@163.com>
* bpo-39310: Update sys.float_info documentation (GH-17982)Victor Stinner2020-01-131-8/+8
| | | Specify that sys.float_info.min is only the minimum normalized float.
* bpo-38920: Add audit hooks for when sys.excepthook and sys.unraisablehook ↵Steve Dower2019-11-281-1/+22
| | | | | are invoked (GH-17392) Also fixes some potential segfaults in unraisable hook handling.
* bpo-38892: Improve docs for audit event (GH-17361)Miss Islington (bot)2019-11-261-3/+3
| | | | | (cherry picked from commit e563a155be60fc0757914f87c8138f10de00bb16) Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
* [3.8] bpo-38738: Fix formatting of True and False. (GH-17083) (GH-17125)Serhiy Storchaka2019-11-121-1/+1
| | | | | | | | | | * "Return true/false" is replaced with "Return ``True``/``False``" if the function actually returns a bool. * Fixed formatting of some True and False literals (now in monospace). * Replaced "True/False" with "true/false" if it can be not only bool. * Replaced some 1/0 with True/False if it corresponds the code. * "Returns <bool>" is replaced with "Return <bool>". (cherry picked from commit 138ccbb02216ca086047c3139857fb44f3dab1f9)
* bpo-38434: Fixes some audit event documentation (GH-16932)Miss Skeleton (bot)2019-10-261-8/+11
| | | | | (cherry picked from commit 894e30ce0bcc1c509eb01c8ffa9ba6d7701aeaaf) Co-authored-by: Steve Dower <steve.dower@python.org>
* bpo-37937: Mention frame.f_trace in sys.settrace docs (GH-15439)Miss Islington (bot)2019-09-201-0/+11
| | | | | | | | Mention frame.f_trace in sys.settrace docs, as well as the fact you still need to call `sys.settrace` to enable the tracing machinery before setting `frame.f_trace` will have any effect. (cherry picked from commit 9c2682efc69568e1b42a0c1759489d6f2e3b30ea) Co-authored-by: Ram Rachum <ram@rachum.com>
* bpo-38096: Clean up the "struct sequence" / "named tuple" docs (GH-15895) ↵Paul Ganssle2019-09-121-6/+6
| | | | (GH-15961)
* bpo-36270: Doc: add link to traceback object reference (GH-13119)Miss Islington (bot)2019-09-111-1/+1
| | | | | (cherry picked from commit 9936371af298d465095ae70bc9c2943b4b16eac4) Co-authored-by: Björn Meier <bjoern@opentrash.org>
* Correct minor gramatical mistake in sys.settrace doc (GH-15637)Miss Islington (bot)2019-09-051-1/+2
| | | | | (cherry picked from commit 3038e87ba848023470f571242a8bb5a206c24430) Co-authored-by: Andre Delfino <adelfino@gmail.com>
* bpo-37284: Add note to sys.implementation doc (GH-14328)Miss Islington (bot)2019-07-151-0/+4
| | | | | | | | Add a brief note to indicate that any new required attributes must go through the PEP process. https://bugs.python.org/issue37284 (cherry picked from commit 52693c10e82622d883433b779a45d0bd792f17ed) Co-authored-by: Giovanni Cappellotto <gcappellotto@fb.com>
* bpo-37363: Add audit events on startup for the run commands (GH-14524)Miss Islington (bot)2019-07-011-0/+6
| | | | | (cherry picked from commit e226e83d36dfc7220d836fb7a249ce18e70cb4a6) Co-authored-by: Steve Dower <steve.dower@python.org>
* bpo-37390: Add audit event table to documentations (GH-14406)Miss Islington (bot)2019-06-271-6/+9
| | | | | | Also updates some (unreleased) event names to be consistent with the others. (cherry picked from commit 44f91c388a6f4da9ed3300df32ca290b8aa104ea) Co-authored-by: Steve Dower <steve.dower@python.org>
* bpo-36707: Document "m" removal from sys.abiflags (GH-14090)Miss Islington (bot)2019-06-151-0/+4
| | | | | (cherry picked from commit 7efc526e5cfb929a79c192ac2dcf7eb78d3a4401) Co-authored-by: Victor Stinner <vstinner@redhat.com>
* bpo-37261: Document sys.unraisablehook corner cases (GH-14059)Miss Islington (bot)2019-06-141-3/+11
| | | | | | | | | | | | | | Document reference cycle and resurrected objects issues in sys.unraisablehook() and threading.excepthook() documentation. Fix test.support.catch_unraisable_exception(): __exit__() no longer ignores unraisable exceptions. Fix test_io test_writer_close_error_on_close(): use a second catch_unraisable_exception() to catch the BufferedWriter unraisable exception. (cherry picked from commit 212646cae6b7c4ddc8d98c8b9b6d39a5f259e864) Co-authored-by: Victor Stinner <vstinner@redhat.com>
* bpo-36933: Remove sys.set_coroutine_wrapper (marked for removal in 3.8) ↵Matthias Bussonnier2019-05-281-59/+0
| | | | | | | | | | (GH-13577) It has been documented as deprecated and to be removed in 3.8; From a comment on another thread – which I can't find ; leave get_coro_wrapper() for now, but always return `None`. https://bugs.python.org/issue36933
* bpo-1230540: Add threading.excepthook() (GH-13515)Victor Stinner2019-05-271-1/+5
| | | | | | | | | | | | | | | | | | | Add a new threading.excepthook() function which handles uncaught Thread.run() exception. It can be overridden to control how uncaught exceptions are handled. threading.ExceptHookArgs is not documented on purpose: it should not be used directly. * threading.excepthook() and threading.ExceptHookArgs. * Add _PyErr_Display(): similar to PyErr_Display(), but accept a 'file' parameter. * Add _thread._excepthook(): C implementation of the exception hook calling _PyErr_Display(). * Add _thread._ExceptHookArgs: structseq type. * Add threading._invoke_excepthook_wrapper() which handles the gory details to ensure that everything remains alive during Python shutdown. * Add unit tests.
* bpo-36829: Add _PyErr_WriteUnraisableMsg() (GH-13488)Victor Stinner2019-05-271-0/+5
| | | | | * sys.unraisablehook: add 'err_msg' field to UnraisableHookArgs. * Use _PyErr_WriteUnraisableMsg() in _ctypes _DictRemover_call() and gc delete_garbage().
* bpo-36842: Implement PEP 578 (GH-12613)Steve Dower2019-05-231-0/+63
| | | Adds sys.audit, sys.addaudithook, io.open_code, and associated C APIs.
* bpo-36829: Add sys.unraisablehook() (GH-13187)Victor Stinner2019-05-221-4/+29
| | | | | | | | | | | | | | | | | | | Add new sys.unraisablehook() function which can be overridden to control how "unraisable exceptions" are handled. It is called when an exception has occurred but there is no way for Python to handle it. For example, when a destructor raises an exception or during garbage collection (gc.collect()). Changes: * Add an internal UnraisableHookArgs type used to pass arguments to sys.unraisablehook. * Add _PyErr_WriteUnraisableDefaultHook(). * The default hook now ignores exception on writing the traceback. * test_sys now uses unittest.main() to automatically discover tests: remove test_main(). * Add _PyErr_Init(). * Fix PyErr_WriteUnraisable(): hold a strong reference to sys.stderr while using it
* bpo-36932: use proper deprecation-removed directive (GH-13349)Matthias Bussonnier2019-05-211-1/+1
| | | | | | | | .. And update some deprecation warnings with version numbers. https://bugs.python.org/issue36932
* Doc: Add link threading.settrace to sys.settrace (GH-13345)Stefan Hoelzl2019-05-171-2/+2
|
* bpo-36588: On AIX, remove major version from sys.platform (GH-12787)Michael Felt2019-04-121-1/+10
| | | | | | On AIX, sys.platform doesn't contain the major version anymore. Always return 'aix', instead of 'aix3' .. 'aix7'. Since older Python versions include the version number, it is recommended to always use sys.platform.startswith('aix').
* bpo-17110: doc: add note how to get bytes from sys.argv (GH-12602)Inada Naoki2019-03-301-0/+6
|
* bpo-31904: Add encoding support for VxWorks RTOS (GH-12051)pxinwr2019-03-041-2/+6
| | | | | | | | 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-30410: Documentation of sys.stdin/out/err update to reflect change in ↵Lysandros Nikolaou2019-02-141-7/+24
| | | | | | | | | | | 3.6 (GH-10264) Documentation of sys.stdin/out/err update to reflect change in 3.6 on Windows to use UTF-8. Wording by Eryk Sun and Paul Moore. https://bugs.python.org/issue30410
* Fixed missing colun in library/sys.po (GH-11153)Jules Lasne (jlasne)2018-12-141-1/+1
| | | | | | # Fixed missing colun in library/sys.po [bpo-35492](https://bugs.python.org/issue35492): Fixed missing colun in library/sys.po
* bpo-35054: Add more index entries for symbols. (GH-10064)Serhiy Storchaka2018-10-261-0/+2
|
* bpo-11233: Create availability directive for documentation (GH-9692)Cheryl Sabella2018-10-121-7/+13
| | | | | | Replace "Availability: xxx" with ".. availability:: xxx" in the doc. Original patch by Georg Brandl. Co-Authored-By: Georg Brandl <georg@python.org>
* bpo-34901: add isolated (-I) flag to sys.flags (GH-9708)Danish Prakash2018-10-071-0/+4
| | | https://bugs.python.org/issue34901
* closes bpo-34502: Remove a note about utf8_mode from sys.exit() docs. (GH-8928)Alexey Izbyshev2018-08-251-3/+0
|
* bpo-33499: Add PYTHONPYCACHEPREFIX env var for alt bytecode cache location. ↵Carl Meyer2018-06-161-0/+20
| | | | | | | | | | | | | | | (GH-6834) In some development setups it is inconvenient or impossible to write bytecode caches to the code tree, but the bytecode caches are still useful. The PYTHONPYCACHEPREFIX environment variable allows specifying an alternate location for cached bytecode files, within which a directory tree mirroring the code tree will be created. This cache tree is then used (for both reading and writing) instead of the local `__pycache__` subdirectory within each source directory. Exposed at runtime as sys.pycache_prefix (defaulting to None), and can be set from the CLI as "-X pycache_prefix=path". Patch by Carl Meyer.
* bpo-32532: Improve documentation of settrace and setprofile (#5359)Xiang Zhang2018-01-271-1/+5
| | | | | Mention in the documentation of settrace and setprofile that errors in the registered handlers will cause themselves unset.
* bpo-17799: Explain real behaviour of sys.settrace and sys.setprofile (#4056)Pablo Galindo2018-01-241-17/+32
|
* bpo-32591: Add native coroutine origin tracking (#5250)Nathaniel J. Smith2018-01-211-0/+40
| | | | | | * Add coro.cr_origin and sys.set_coroutine_origin_tracking_depth * Use coroutine origin information in the unawaited coroutine warning * Stop using set_coroutine_wrapper in asyncio debug mode * In BaseEventLoop.set_debug, enable debugging in the correct thread
* bpo-29240: PEP 540: Add a new UTF-8 Mode (#855)Victor Stinner2017-12-131-1/+12
| | | | | | | | | | | | | | | | | | | | | | * 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-32101: Add PYTHONDEVMODE environment variable (#4624)Victor Stinner2017-11-301-0/+4
| | | | | | * bpo-32101: Add sys.flags.dev_mode flag Rename also the "Developer mode" to the "Development mode". * bpo-32101: Add PYTHONDEVMODE environment variable Mention it in the development chapiter.
* Fix miscellaneous typos (#4275)luzpaz2017-11-051-1/+1
|
* bpo-28647: Update -u documentation after bpo-30404 (GH-3961)Berker Peksag2017-10-131-3/+3
|
* PEP 553 built-in breakpoint() function (bpo-31353) (#3355)Barry Warsaw2017-10-051-4/+43
| | | Implement PEP 553, built-in breakpoint() with support from sys.breakpointhook(), along with documentation and tests. Closes bpo-31353
* bpo-31344: Per-frame control of trace events (GH-3417)Nick Coghlan2017-09-081-1/+16
| | | | | | | | | f_trace_lines: enable/disable line trace events f_trace_opcodes: enable/disable opcode trace events These are intended primarily for testing of the interpreter itself, as they make it much easier to emulate signals arriving at unfortunate times.
* Spelling fixes (#2902)Ville Skyttä2017-08-031-1/+1
|
* Merge 3.6 (issue #28091)Yury Selivanov2016-12-151-0/+36
|\
| * Issue #28091: Document PEP 525 & PEP 530.Yury Selivanov2016-12-151-0/+36
| | | | | | | | Patch by Eric Appelt.
* | Add sys.getandroidapilevel()Victor Stinner2016-12-021-0/+9
|/ | | | | | | Issue #28740: Add sys.getandroidapilevel(): return the build time API version of Android as an integer. Function only available on Android.
* Issue #19795: Mark up None as literal text.Serhiy Storchaka2016-10-191-1/+1
|\
| * Issue #19795: Mark up None as literal text.Serhiy Storchaka2016-10-191-1/+1
| |
* | Issue #27932: Prevent memory leak in win32_ver().Steve Dower2016-09-181-16/+11
| |
* | remove ceval timestamp supportBenjamin Peterson2016-09-091-12/+0
| |