Skip to content

Commit

Permalink
pythongh-90300: Document equivalent -X options for envvars in the Pyt…
Browse files Browse the repository at this point in the history
…hon CLI help (pythonGH-116756)
  • Loading branch information
serhiy-storchaka authored and diegorusso committed Apr 17, 2024
1 parent aad8d62 commit f00d12e
Showing 1 changed file with 31 additions and 29 deletions.
60 changes: 31 additions & 29 deletions Python/initconfig.c
Original file line number Diff line number Diff line change
Expand Up @@ -259,18 +259,11 @@ static const char usage_envvars[] =
" The default module search path uses %s.\n"
"PYTHONPLATLIBDIR: override sys.platlibdir.\n"
"PYTHONCASEOK : ignore case in 'import' statements (Windows).\n"
"PYTHONUTF8 : if set to 1, enable the UTF-8 mode.\n"
"PYTHONIOENCODING: Encoding[:errors] used for stdin/stdout/stderr.\n"
"PYTHONFAULTHANDLER: dump the Python traceback on fatal errors.\n"
"PYTHONHASHSEED : if this variable is set to 'random', a random value is used\n"
" to seed the hashes of str and bytes objects. It can also be\n"
" set to an integer in the range [0,4294967295] to get hash\n"
" values with a predictable seed.\n"
"PYTHONINTMAXSTRDIGITS: limits the maximum digit characters in an int value\n"
" when converting from a string and when converting an int\n"
" back to a str. A value of 0 disables the limit.\n"
" Conversions to or from bases 2, 4, 8, 16, and 32 are never\n"
" limited.\n"
"PYTHONMALLOC : set the Python memory allocators and/or install debug hooks\n"
" on Python memory allocators. Use PYTHONMALLOC=debug to\n"
" install debug hooks.\n"
Expand All @@ -281,47 +274,56 @@ static const char usage_envvars[] =
"PYTHONBREAKPOINT: if this variable is set to 0, it disables the default\n"
" debugger. It can be set to the callable of your debugger of\n"
" choice.\n"
"PYTHON_CPU_COUNT: Overrides the return value of os.process_cpu_count(),\n"
" os.cpu_count(), and multiprocessing.cpu_count() if set to\n"
" a positive integer.\n"
#ifdef Py_GIL_DISABLED
"PYTHON_GIL : When set to 0, disables the GIL.\n"
#endif
"PYTHONDEVMODE : enable the development mode.\n"
"PYTHONPYCACHEPREFIX: root directory for bytecode cache (pyc) files.\n"
"PYTHONWARNDEFAULTENCODING: enable opt-in EncodingWarning for 'encoding=None'.\n"
"PYTHONNODEBUGRANGES: if this variable is set, it disables the inclusion of\n"
" the tables mapping extra location information (end line,\n"
" start column offset and end column offset) to every\n"
" instruction in code objects. This is useful when smaller\n"
" code objects and pyc files are desired as well as\n"
" suppressing the extra visual location indicators when the\n"
" interpreter displays tracebacks.\n"
"PYTHON_FROZEN_MODULES: if this variable is set, it determines whether or not\n"
" frozen modules should be used. The default is \"on\" (or\n"
" \"off\" if you are running a local build).\n"
"PYTHON_COLORS : if this variable is set to 1, the interpreter will colorize\n"
" various kinds of output. Setting it to 0 deactivates\n"
" this behavior.\n"
"PYTHON_HISTORY : the location of a .python_history file.\n"
"\n"
"These variables have equivalent command-line options (see --help for details):\n"
"PYTHON_CPU_COUNT: Overrides the return value of os.process_cpu_count(),\n"
" os.cpu_count(), and multiprocessing.cpu_count() if set to\n"
" a positive integer. (-X cpu_count)\n"
"PYTHONDEBUG : enable parser debug mode (-d)\n"
"PYTHONDEVMODE : enable the development mode (-X dev)\n"
"PYTHONDONTWRITEBYTECODE: don't write .pyc files (-B)\n"
"PYTHONFAULTHANDLER: dump the Python traceback on fatal errors (-X faulthandler)\n"
"PYTHON_FROZEN_MODULES: if this variable is set, it determines whether or not\n"
" frozen modules should be used. The default is \"on\" (or\n"
" \"off\" if you are running a local build).\n"
" (-X frozen_modules)\n"
#ifdef Py_GIL_DISABLED
"PYTHON_GIL : when set to 0, disables the GIL (-X gil)\n"
#endif
"PYTHONINSPECT : inspect interactively after running script (-i)\n"
"PYTHONINTMAXSTRDIGITS: limit max digit characters in an int value\n"
"PYTHONINTMAXSTRDIGITS: limits the maximum digit characters in an int value\n"
" when converting from a string and when converting an int\n"
" back to a str. A value of 0 disables the limit.\n"
" Conversions to or from bases 2, 4, 8, 16, and 32 are never\n"
" limited.\n"
" (-X int_max_str_digits=number)\n"
"PYTHONNODEBUGRANGES: if this variable is set, it disables the inclusion of\n"
" the tables mapping extra location information (end line,\n"
" start column offset and end column offset) to every\n"
" instruction in code objects. This is useful when smaller\n"
" code objects and pyc files are desired as well as\n"
" suppressing the extra visual location indicators when the\n"
" interpreter displays tracebacks. (-X no_debug_ranges)\n"
"PYTHONNOUSERSITE: disable user site directory (-s)\n"
"PYTHONOPTIMIZE : enable level 1 optimizations (-O)\n"
#ifdef Py_DEBUG
"PYTHON_PRESITE=pkg.mod: import this module before site.py is run\n"
"PYTHON_PRESITE=pkg.mod: import this module before site.py is run (-X presite)\n"
#endif
"PYTHONPYCACHEPREFIX: root directory for bytecode cache (pyc) files\n"
" (-X pycache_prefix)\n"
"PYTHONSAFEPATH : don't prepend a potentially unsafe path to sys.path.\n"
#ifdef Py_STATS
"PYTHONSTATS : turns on statistics gathering\n"
"PYTHONSTATS : turns on statistics gathering (-X pystats)\n"
#endif
"PYTHONUNBUFFERED: disable stdout/stderr buffering (-u)\n"
"PYTHONUTF8 : if set to 1, enable the UTF-8 mode (-X utf8)\n"
"PYTHONVERBOSE : trace import statements (-v)\n"
"PYTHONWARNDEFAULTENCODING: enable opt-in EncodingWarning for 'encoding=None'\n"
" (-X warn_default_encoding)\n"
"PYTHONWARNINGS=arg: warning control (-W arg)\n"
;

Expand Down

0 comments on commit f00d12e

Please sign in to comment.