PEP 741: Update options (#3927)

* Remove read-only options:

  * "module_search_paths_set": not useful, always true.
  * "pythonpath_env": get os.environ['PYTHONPATH'] directly.
  * "sys_path_0": only make sense during Python initialization.
  * "_install_importlib", "_init_main", "_is_python_build": private
    options which only make sense during Python initialization.

* Fix related sys API for base_executable and exec_prefix.
* legacy_windows_fs_encoding is Windows only.
* Fix sorting.
This commit is contained in:
Victor Stinner 2024-09-02 23:19:23 +02:00 committed by GitHub
parent 82dfea0b87
commit dc700c2cf8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 9 additions and 27 deletions

View File

@ -276,7 +276,7 @@ Following options can be get by ``PyConfig_Get()`` and set and
- API: ``sys.base_exec_prefix``.
* - ``base_executable``
- ``str``
- API: ``sys.base_executable``.
- API: ``sys._base_executable``.
* - ``base_prefix``
- ``str``
- API: ``sys.base_prefix``.
@ -285,7 +285,7 @@ Following options can be get by ``PyConfig_Get()`` and set and
- API: ``sys.flags.bytes_warning``.
* - ``exec_prefix``
- ``str``
- API: ``sys.base_prefix``.
- API: ``sys.exec_prefix``.
* - ``executable``
- ``str``
- API: ``sys.executable``.
@ -370,7 +370,7 @@ Following options can be get by ``PyConfig_Get()``, but cannot be set by
-
* - ``check_hash_pycs_mode``
- ``str``
- API: ``imp.check_hash_pycs_mode``.
-
* - ``code_debug_ranges``
- ``bool``
-
@ -424,23 +424,20 @@ Following options can be get by ``PyConfig_Get()``, but cannot be set by
- API: ``sys.flags.isolated`` (``int``).
* - ``legacy_windows_fs_encoding``
- ``bool``
-
- Windows only.
* - ``legacy_windows_stdio``
- ``bool``
- Windows only.
* - ``malloc_stats``
- ``bool``
-
* - ``module_search_paths_set``
- ``bool``
-
* - ``orig_argv``
- ``list[str]``
- API: ``sys.orig_argv``.
* - ``pathconfig_warnings``
* - ``parse_argv``
- ``bool``
-
* - ``parse_argv``
* - ``pathconfig_warnings``
- ``bool``
-
* - ``perf_profiling``
@ -449,9 +446,6 @@ Following options can be get by ``PyConfig_Get()``, but cannot be set by
* - ``program_name``
- ``str``
-
* - ``pythonpath_env``
- ``str``
-
* - ``run_command``
- ``str``
-
@ -484,9 +478,6 @@ Following options can be get by ``PyConfig_Get()``, but cannot be set by
- ``str``
- API: ``sys.stdin.errors``, ``sys.stdout.errors`` and
``sys.stderr.errors``.
* - ``sys_path_0``
- ``str``
-
* - ``tracemalloc``
- ``int``
- API: ``tracemalloc.is_tracing()`` (``bool``).
@ -496,24 +487,15 @@ Following options can be get by ``PyConfig_Get()``, but cannot be set by
* - ``use_hash_seed``
- ``bool``
-
* - ``utf8_mode``
- ``bool``
-
* - ``user_site_directory``
- ``bool``
- API: ``sys.flags.no_user_site`` (``int``).
* - ``utf8_mode``
- ``bool``
-
* - ``warn_default_encoding``
- ``bool``
-
* - ``_install_importlib``
- ``bool``
-
* - ``_init_main``
- ``bool``
-
* - ``_is_python_build``
- ``bool``
-
* - ``_pystats``
- ``bool``
- API: ``sys._stats_on()``, ``sys._stats_off()``.