Skip to content

Commit f00d12e

Browse files
serhiy-storchakadiegorusso
authored andcommitted
pythongh-90300: Document equivalent -X options for envvars in the Python CLI help (pythonGH-116756)
1 parent aad8d62 commit f00d12e

File tree

1 file changed

+31
-29
lines changed

1 file changed

+31
-29
lines changed

Python/initconfig.c

+31-29
Original file line numberDiff line numberDiff line change
@@ -259,18 +259,11 @@ static const char usage_envvars[] =
259259
" The default module search path uses %s.\n"
260260
"PYTHONPLATLIBDIR: override sys.platlibdir.\n"
261261
"PYTHONCASEOK : ignore case in 'import' statements (Windows).\n"
262-
"PYTHONUTF8 : if set to 1, enable the UTF-8 mode.\n"
263262
"PYTHONIOENCODING: Encoding[:errors] used for stdin/stdout/stderr.\n"
264-
"PYTHONFAULTHANDLER: dump the Python traceback on fatal errors.\n"
265263
"PYTHONHASHSEED : if this variable is set to 'random', a random value is used\n"
266264
" to seed the hashes of str and bytes objects. It can also be\n"
267265
" set to an integer in the range [0,4294967295] to get hash\n"
268266
" values with a predictable seed.\n"
269-
"PYTHONINTMAXSTRDIGITS: limits the maximum digit characters in an int value\n"
270-
" when converting from a string and when converting an int\n"
271-
" back to a str. A value of 0 disables the limit.\n"
272-
" Conversions to or from bases 2, 4, 8, 16, and 32 are never\n"
273-
" limited.\n"
274267
"PYTHONMALLOC : set the Python memory allocators and/or install debug hooks\n"
275268
" on Python memory allocators. Use PYTHONMALLOC=debug to\n"
276269
" install debug hooks.\n"
@@ -281,47 +274,56 @@ static const char usage_envvars[] =
281274
"PYTHONBREAKPOINT: if this variable is set to 0, it disables the default\n"
282275
" debugger. It can be set to the callable of your debugger of\n"
283276
" choice.\n"
284-
"PYTHON_CPU_COUNT: Overrides the return value of os.process_cpu_count(),\n"
285-
" os.cpu_count(), and multiprocessing.cpu_count() if set to\n"
286-
" a positive integer.\n"
287-
#ifdef Py_GIL_DISABLED
288-
"PYTHON_GIL : When set to 0, disables the GIL.\n"
289-
#endif
290-
"PYTHONDEVMODE : enable the development mode.\n"
291-
"PYTHONPYCACHEPREFIX: root directory for bytecode cache (pyc) files.\n"
292-
"PYTHONWARNDEFAULTENCODING: enable opt-in EncodingWarning for 'encoding=None'.\n"
293-
"PYTHONNODEBUGRANGES: if this variable is set, it disables the inclusion of\n"
294-
" the tables mapping extra location information (end line,\n"
295-
" start column offset and end column offset) to every\n"
296-
" instruction in code objects. This is useful when smaller\n"
297-
" code objects and pyc files are desired as well as\n"
298-
" suppressing the extra visual location indicators when the\n"
299-
" interpreter displays tracebacks.\n"
300-
"PYTHON_FROZEN_MODULES: if this variable is set, it determines whether or not\n"
301-
" frozen modules should be used. The default is \"on\" (or\n"
302-
" \"off\" if you are running a local build).\n"
303277
"PYTHON_COLORS : if this variable is set to 1, the interpreter will colorize\n"
304278
" various kinds of output. Setting it to 0 deactivates\n"
305279
" this behavior.\n"
306280
"PYTHON_HISTORY : the location of a .python_history file.\n"
307281
"\n"
308282
"These variables have equivalent command-line options (see --help for details):\n"
283+
"PYTHON_CPU_COUNT: Overrides the return value of os.process_cpu_count(),\n"
284+
" os.cpu_count(), and multiprocessing.cpu_count() if set to\n"
285+
" a positive integer. (-X cpu_count)\n"
309286
"PYTHONDEBUG : enable parser debug mode (-d)\n"
287+
"PYTHONDEVMODE : enable the development mode (-X dev)\n"
310288
"PYTHONDONTWRITEBYTECODE: don't write .pyc files (-B)\n"
289+
"PYTHONFAULTHANDLER: dump the Python traceback on fatal errors (-X faulthandler)\n"
290+
"PYTHON_FROZEN_MODULES: if this variable is set, it determines whether or not\n"
291+
" frozen modules should be used. The default is \"on\" (or\n"
292+
" \"off\" if you are running a local build).\n"
293+
" (-X frozen_modules)\n"
294+
#ifdef Py_GIL_DISABLED
295+
"PYTHON_GIL : when set to 0, disables the GIL (-X gil)\n"
296+
#endif
311297
"PYTHONINSPECT : inspect interactively after running script (-i)\n"
312-
"PYTHONINTMAXSTRDIGITS: limit max digit characters in an int value\n"
298+
"PYTHONINTMAXSTRDIGITS: limits the maximum digit characters in an int value\n"
299+
" when converting from a string and when converting an int\n"
300+
" back to a str. A value of 0 disables the limit.\n"
301+
" Conversions to or from bases 2, 4, 8, 16, and 32 are never\n"
302+
" limited.\n"
313303
" (-X int_max_str_digits=number)\n"
304+
"PYTHONNODEBUGRANGES: if this variable is set, it disables the inclusion of\n"
305+
" the tables mapping extra location information (end line,\n"
306+
" start column offset and end column offset) to every\n"
307+
" instruction in code objects. This is useful when smaller\n"
308+
" code objects and pyc files are desired as well as\n"
309+
" suppressing the extra visual location indicators when the\n"
310+
" interpreter displays tracebacks. (-X no_debug_ranges)\n"
314311
"PYTHONNOUSERSITE: disable user site directory (-s)\n"
315312
"PYTHONOPTIMIZE : enable level 1 optimizations (-O)\n"
316313
#ifdef Py_DEBUG
317-
"PYTHON_PRESITE=pkg.mod: import this module before site.py is run\n"
314+
"PYTHON_PRESITE=pkg.mod: import this module before site.py is run (-X presite)\n"
318315
#endif
316+
"PYTHONPYCACHEPREFIX: root directory for bytecode cache (pyc) files\n"
317+
" (-X pycache_prefix)\n"
319318
"PYTHONSAFEPATH : don't prepend a potentially unsafe path to sys.path.\n"
320319
#ifdef Py_STATS
321-
"PYTHONSTATS : turns on statistics gathering\n"
320+
"PYTHONSTATS : turns on statistics gathering (-X pystats)\n"
322321
#endif
323322
"PYTHONUNBUFFERED: disable stdout/stderr buffering (-u)\n"
323+
"PYTHONUTF8 : if set to 1, enable the UTF-8 mode (-X utf8)\n"
324324
"PYTHONVERBOSE : trace import statements (-v)\n"
325+
"PYTHONWARNDEFAULTENCODING: enable opt-in EncodingWarning for 'encoding=None'\n"
326+
" (-X warn_default_encoding)\n"
325327
"PYTHONWARNINGS=arg: warning control (-W arg)\n"
326328
;
327329

0 commit comments

Comments
 (0)