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