summaryrefslogtreecommitdiffstats
path: root/Doc/library/sys.rst
Commit message (Collapse)AuthorAgeFilesLines
* gh-106847: Add -X warn_default_encoding in sys.flags Doc (#106854)qqwqqw6892023-07-211-21/+25
| | | Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
* gh-106909: Use role :const: for referencing module constants (GH-106910)Serhiy Storchaka2023-07-211-2/+2
|
* gh-106892: Use roles :data: and :const: for referencing module variables ↵Serhiy Storchaka2023-07-211-5/+5
| | | | (GH-106894)
* GH-97950: Use new-style index directive ('object') (#104158)Adam Turner2023-05-041-1/+1
| | | | | | | | | | | * Uncomment object removal in pairindextypes * Use new-style index directive ('object') - C API * Use new-style index directive ('object') - Library * Use new-style index directive ('object') - Reference * Use new-style index directive ('object') - Tutorial
* gh-98040: Remove find_loader, find_module and other deprecated APIs (#98059)Barry Warsaw2023-05-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Remove deprecated classes from pkgutil * Remove some other PEP 302 obsolescence * Use find_spec instead of load_module * Remove more tests of PEP 302 obsolete APIs * Remove another bunch of tests using obsolete load_modules() * Remove deleted names from __all__ * Remove obsolete footnote * imp is removed * Remove `imp` from generated stdlib names * What's new and blurb * Update zipimport documentation for the removed methods * Fix some Windows tests * Remove any test (or part of a test) that references `find_module()`. * Use assertIsNone() / assertIsNotNone() consistently. * Update Doc/reference/import.rst * We don't need pkgutil._get_spec() any more either * test.test_importlib.fixtures.NullFinder * ...BadLoaderFinder.find_module * ...test_api.InvalidatingNullFinder.find_module * ...test.test_zipimport test of z.find_module * Suppress cross-references to find_loader and find_module * Suppress cross-references to Finder * Suppress cross-references to pkgutil.ImpImporter and pkgutil.ImpLoader --------- Co-authored-by: Oleg Iarygin <oleg@arhadthedev.net> Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
* GH-103484: Fix redirected permanently URLs (#104001)Rafael Fontenelle2023-05-021-1/+1
| | | | | Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com> Co-authored-by: Oleg Iarygin <dralife@yandex.ru>
* gh-98040: Remove just the `imp` module (#98573)Barry Warsaw2023-04-281-4/+0
|
* gh-84436: Implement Immortal Objects (gh-19474)Eddie Elizondo2023-04-221-0/+7
| | | | | | | | | This is the implementation of PEP683 Motivation: The PR introduces the ability to immortalize instances in CPython which bypasses reference counting. Tagging objects as immortal allows up to skip certain operations when we know that the object will be around for the entire execution of the runtime. Note that this by itself will bring a performance regression to the runtime due to the extra reference count checks. However, this brings the ability of having truly immutable objects that are useful in other contexts such as immutable data sharing between sub-interpreters.
* gh-103176: sys._current_exceptions() returns mapping to exception instances ↵Irit Katriel2023-04-111-0/+4
| | | | instead of exc_info tuples (#103177)
* gh-102899: Fix doc link for getting filesystem error handler (#102901)Olivier Gayot2023-04-051-1/+1
|
* gh-102778: Add sys.last_exc, deprecate sys.last_type, ↵Irit Katriel2023-03-181-11/+14
| | | | sys.last_value,sys.last_traceback (#102779)
* 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>
* GH-90744: Fix erroneous doc links in the sys module (#101319)Furkan Onder2023-02-281-49/+49
| | | | Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
* gh-86682: Adds sys._getframemodulename as an alternative to using _getframe ↵Steve Dower2023-01-131-0/+16
| | | | | (GH-99520) Also updates calls in collections, doctest, enum, and typing modules to use _getframemodulename first when available.
* GH-100894: Updated the doc for `sys.winver` to clarify its usual contents ↵ram vikram singh2023-01-121-1/+1
| | | | (GH-100913)
* gh-85988: Change documentation for sys.float_info.rounds (GH-99675)Brad Wolfe2022-11-271-6/+12
| | | | | | | | | | | | | | | | | | | | * Change documentation for sys.float_info.rounds Change the documentation for sys.float_info.rounds to remove references to C99 section 5.2.4.2.2 and instead place the available values inline. * Correction to previous documentation change Newlines were not preserved in generated HTML on previous commit. I have changes the list to a comma-separated list of values and their meanings. * Clarify source for value of FLT_ROUNDS Clarify the source of the FLT_ROUNDS value and change 'floating-point addition' to 'floating-point arithmetic' to indicate that the rounding mode applies to all arithmetic operations.
* gh-87604: Clarify in docs that sys.addaudithook is not for sandboxes (GH-99372)Steve Dower2022-11-111-0/+9
|
* Fix typo in docs (GH-98863)Yuvi Panda2022-10-291-1/+1
|
* gh-96143: Improve perf profiler docs (#96445)Erlend E. Aasland2022-10-271-0/+32
|
* Docs: Fix backtick errors found by sphinx-lint (#97998)Hugo van Kemenade2022-10-071-3/+3
| | | Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
* gh-96512: Update int_max_str docs to say 3.11 (#96942)Gregory P. Smith2022-09-191-4/+4
| | | | It was unknown if it'd be before 3.11.0 when creating the original changes. It's in 3.11rc2, so 3.11 it is.
* gh-95778: Fix `sys.set_int_max_str_digits()` parameter name (#96798)Alex Waygood2022-09-131-1/+1
| | | Discovered in https://github.com/python/typeshed/pull/8733
* gh-95778: CVE-2020-10735: Prevent DoS by very large int() (#96499)Gregory P. Smith2022-09-021-13/+44
| | | | | | | | | | | | | | | | Integer to and from text conversions via CPython's bignum `int` type is not safe against denial of service attacks due to malicious input. Very large input strings with hundred thousands of digits can consume several CPU seconds. This PR comes fresh from a pile of work done in our private PSRT security response team repo. Signed-off-by: Christian Heimes [Red Hat] <christian@python.org> Tons-of-polishing-up-by: Gregory P. Smith [Google] <greg@krypto.org> Reviews via the private PSRT repo via many others (see the NEWS entry in the PR). <!-- gh-issue-number: gh-95778 --> * Issue: gh-95778 <!-- /gh-issue-number --> I wrote up [a one pager for the release managers](https://docs.google.com/document/d/1KjuF_aXlzPUxTK4BMgezGJ2Pn7uevfX7g0_mvgHlL7Y/edit#). Much of that text wound up in the Issue. Backports PRs already exist. See the issue for links.
* gh-91838: Use HTTPS links in docs for resources which redirect to HTTPS ↵Serhiy Storchaka2022-08-041-1/+1
| | | | | | | | | | (GH-95527) If an HTTP link is redirected to a same looking HTTPS link, the latter can be used directly without changes in readability and behavior. It protects from a men-in-the-middle attack. This change does not affect Python examples.
* bpo-45445: Revert "bpo-45445: Fail if an invalid X-option is provided in the ↵Pablo Galindo Salgado2022-07-311-2/+2
| | | | command line (GH-28823)" (#94745)
* gh-95415: Make availability directive consistent (GH-95416)Christian Heimes2022-07-291-1/+1
|
* gh-95174: Add pthread stubs for WASI (GH-95234)Christian Heimes2022-07-271-0/+2
| | | Co-authored-by: Brett Cannon <brett@python.org>
* gh-91348: Restore frame argument to sys._getframe audit event (GH-94928)Steve Dower2022-07-171-1/+1
|
* gh-91181: drop support for bytes on sys.path (GH-31934)Thomas Grainger2022-07-171-1/+1
| | | | | | Support for bytes broke sometime between Python 3.2 and 3.6 and has been broken ever since. Trying to bring back supports is surprisingly difficult in the face of -b and checking for keys in sys.path_importer_cache. Since the support was broken for so long, trying to overcome the difficulty of bringing back the support has been deemed not worth it. Co-authored-by: Eryk Sun <eryksun@gmail.com> Co-authored-by: Brett Cannon <brett@python.org>
* bpo-30535: [doc] state that sys.meta_path is not empty by default (GH-94098)Irit Katriel2022-06-211-1/+2
| | | Co-authored-by: Windson yang <wiwindson@outlook.com>
* gh-57684: Add -P cmdline option and PYTHONSAFEPATH env var (#31542)Victor Stinner2022-05-051-8/+16
| | | | | | | | | | | | Add the -P command line option and the PYTHONSAFEPATH environment variable to not prepend a potentially unsafe path to sys.path. * Add sys.flags.safe_path flag. * Add PyConfig.safe_path member. * Programs/_bootstrap_python.c uses config.safe_path=0. * Update subprocess._optim_args_from_interpreter_flags() to handle the -P command line option. * Modules/getpath.py sets safe_path to 1 if a "._pth" file is present.
* gh-84461: Add sys._emscripten_info, improve docs and build (gh-91781)Christian Heimes2022-04-231-0/+29
|
* gh-90501: Add PyErr_GetHandledException and PyErr_SetHandledException (GH-30531)Irit Katriel2022-04-151-12/+5
|
* bpo-40280: WASM docs and smaller browser builds (GH-32412)Christian Heimes2022-04-101-0/+2
| | | Co-authored-by: Brett Cannon <brett@python.org>
* bpo-31582: Created a new documentation section describing sys.path ↵Russel Webber2022-03-231-3/+4
| | | | initialization (GH-31082)
* bpo-6634: [doc] clarify that sys.exit() does not always exit the interpreter ↵vidhya2022-03-031-5/+3
| | | | (GH-31639)
* bpo-46328: Add sys.exception() (GH-30514)Irit Katriel2022-01-131-15/+30
|
* bpo-45711: Change exc_info related APIs to derive type and traceback from ↵Irit Katriel2021-11-301-3/+8
| | | | the exception instance (GH-29780)
* bpo-45788: Link sys.prefix doc to 'Installation paths' (#29606)Terry Jan Reedy2021-11-181-6/+3
| | | ... To the Installation paths section of the sysconfig doc.
* bpo-45445: Fail if an invalid X-option is provided in the command line ↵Pablo Galindo Salgado2021-10-131-2/+2
| | | | (GH-28823)
* bpo-45353: Remind sys.modules users to copy when iterating. (GH-28842)Gregory P. Smith2021-10-091-1/+5
| | | | | | | | This is true of all dictionaries in Python, but this one tends to catch people off guard as they don't realize when sys.modules might change out from underneath them as a hidden side effect of their code. Copying it first avoids the RuntimeError. An example when this happens in single threaded code are codecs being loaded which are an implicit time of use import that most need not think about.
* bpo-43284: Update platform.win32_ver to use _syscmd_ver instead of ↵Shreyan Avigyan2021-04-221-1/+6
| | | | | | | sys.getwindowsversion() (GH-25500) The sys module uses the kernel32.dll version number, which can vary from the "actual" Windows version. Since the best option for getting the version is WMI (which is expensive), we switch back to launching cmd.exe (which is also expensive, but a lot less code on our part). sys.getwindowsversion() is not updated to avoid launching executables from that module.
* bpo-43475: Fix worst case collision behavior for NaN instances (GH-25493)Raymond Hettinger2021-04-221-1/+1
|
* bpo-43472: Ensure PyInterpreterState_New audit events are raised when called ↵Steve Dower2021-04-211-2/+2
| | | | through _xxsubinterpreters module (GH-25506)
* bpo-43774: Add more links to configure options (GH-25363)Victor Stinner2021-04-121-2/+3
|
* bpo-43774: Document configure options (GH-25283)Victor Stinner2021-04-081-2/+2
| | | | | | Add Doc/using/configure.rst documentation to document configure, preprocessor, compiler and linker options. Add a new section about the "Python debug build".
* bpo-42955: Remove sub-packages from sys.stdlib_module_names (GH-24353)Victor Stinner2021-01-271-3/+4
|
* bpo-42955: Rename module_names to sys.stdlib_module_names (GH-24332)Victor Stinner2021-01-251-19/+19
| | | | * Rename _Py_module_names to _Py_stdlib_module_names. * Rename Python/module_names.h to Python/stdlib_module_names.h.
* bpo-42955: Fix sys.module_names doc (GH-24329)Victor Stinner2021-01-251-1/+1
| | | Replace versionchanged markup with versionadded.
* bpo-42955: Add sys.modules_names (GH-24238)Victor Stinner2021-01-251-1/+21
| | | | Add sys.module_names, containing the list of the standard library module names.