Skip to content

Commit 0ecdaf0

Browse files
[3.11] gh-90300: Document equivalent -X options for envvars in the Python CLI help (GH-116756) (GH-116786) (GH-116796)
(cherry picked from commit 991710a) Co-authored-by: Serhiy Storchaka <[email protected]> (cherry picked from commit 8c6db45) Co-authored-by: Serhiy Storchaka <[email protected]>
1 parent c42e709 commit 0ecdaf0

File tree

1 file changed

+19
-18
lines changed

1 file changed

+19
-18
lines changed

Python/initconfig.c

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -137,18 +137,11 @@ static const char usage_envvars[] =
137137
" The default module search path uses %s.\n"
138138
"PYTHONPLATLIBDIR: override sys.platlibdir.\n"
139139
"PYTHONCASEOK : ignore case in 'import' statements (Windows).\n"
140-
"PYTHONUTF8 : if set to 1, enable the UTF-8 mode.\n"
141140
"PYTHONIOENCODING: Encoding[:errors] used for stdin/stdout/stderr.\n"
142-
"PYTHONFAULTHANDLER: dump the Python traceback on fatal errors.\n"
143141
"PYTHONHASHSEED : if this variable is set to 'random', a random value is used\n"
144142
" to seed the hashes of str and bytes objects. It can also be\n"
145143
" set to an integer in the range [0,4294967295] to get hash\n"
146144
" values with a predictable seed.\n"
147-
"PYTHONINTMAXSTRDIGITS: limits the maximum digit characters in an int value\n"
148-
" when converting from a string and when converting an int\n"
149-
" back to a str. A value of 0 disables the limit.\n"
150-
" Conversions to or from bases 2, 4, 8, 16, and 32 are never\n"
151-
" limited.\n"
152145
"PYTHONMALLOC : set the Python memory allocators and/or install debug hooks\n"
153146
" on Python memory allocators. Use PYTHONMALLOC=debug to\n"
154147
" install debug hooks.\n"
@@ -159,28 +152,36 @@ static const char usage_envvars[] =
159152
"PYTHONBREAKPOINT: if this variable is set to 0, it disables the default\n"
160153
" debugger. It can be set to the callable of your debugger of\n"
161154
" choice.\n"
162-
"PYTHONDEVMODE : enable the development mode.\n"
163-
"PYTHONPYCACHEPREFIX: root directory for bytecode cache (pyc) files.\n"
164-
"PYTHONWARNDEFAULTENCODING: enable opt-in EncodingWarning for 'encoding=None'.\n"
165-
"PYTHONNODEBUGRANGES: if this variable is set, it disables the inclusion of\n"
166-
" the tables mapping extra location information (end line,\n"
167-
" start column offset and end column offset) to every\n"
168-
" instruction in code objects. This is useful when smaller\n"
169-
" code objects and pyc files are desired as well as\n"
170-
" suppressing the extra visual location indicators when the\n"
171-
" interpreter displays tracebacks.\n"
172155
"\n"
173156
"These variables have equivalent command-line options (see --help for details):\n"
174157
"PYTHONDEBUG : enable parser debug mode (-d)\n"
158+
"PYTHONDEVMODE : enable the development mode (-X dev)\n"
175159
"PYTHONDONTWRITEBYTECODE: don't write .pyc files (-B)\n"
160+
"PYTHONFAULTHANDLER: dump the Python traceback on fatal errors (-X faulthandler)\n"
176161
"PYTHONINSPECT : inspect interactively after running script (-i)\n"
177-
"PYTHONINTMAXSTRDIGITS: limit max digit characters in an int value\n"
162+
"PYTHONINTMAXSTRDIGITS: limits the maximum digit characters in an int value\n"
163+
" when converting from a string and when converting an int\n"
164+
" back to a str. A value of 0 disables the limit.\n"
165+
" Conversions to or from bases 2, 4, 8, 16, and 32 are never\n"
166+
" limited.\n"
178167
" (-X int_max_str_digits=number)\n"
168+
"PYTHONNODEBUGRANGES: if this variable is set, it disables the inclusion of\n"
169+
" the tables mapping extra location information (end line,\n"
170+
" start column offset and end column offset) to every\n"
171+
" instruction in code objects. This is useful when smaller\n"
172+
" code objects and pyc files are desired as well as\n"
173+
" suppressing the extra visual location indicators when the\n"
174+
" interpreter displays tracebacks. (-X no_debug_ranges)\n"
179175
"PYTHONNOUSERSITE: disable user site directory (-s)\n"
180176
"PYTHONOPTIMIZE : enable level 1 optimizations (-O)\n"
177+
"PYTHONPYCACHEPREFIX: root directory for bytecode cache (pyc) files\n"
178+
" (-X pycache_prefix)\n"
181179
"PYTHONSAFEPATH : don't prepend a potentially unsafe path to sys.path.\n"
182180
"PYTHONUNBUFFERED: disable stdout/stderr buffering (-u)\n"
181+
"PYTHONUTF8 : if set to 1, enable the UTF-8 mode (-X utf8)\n"
183182
"PYTHONVERBOSE : trace import statements (-v)\n"
183+
"PYTHONWARNDEFAULTENCODING: enable opt-in EncodingWarning for 'encoding=None'\n"
184+
" (-X warn_default_encoding)\n"
184185
"PYTHONWARNINGS=arg: warning control (-W arg)\n"
185186
;
186187

0 commit comments

Comments
 (0)