Skip to content

Commit 33336e4

Browse files
gh-93217: fix some issues in man page and --help (GH-93219)
(cherry picked from commit da39719) Co-authored-by: Éric <[email protected]>
1 parent 9555d77 commit 33336e4

File tree

2 files changed

+20
-8
lines changed

2 files changed

+20
-8
lines changed

Misc/python.man

+16-3
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,10 @@ python \- an interpreted, interactive, object-oriented programming language
6969
.B \-x
7070
]
7171
[
72-
[
7372
.B \-X
7473
.I option
7574
]
75+
[
7676
.B \-?
7777
]
7878
.br
@@ -310,7 +310,8 @@ Set implementation specific option. The following options are available:
310310
more verbose than the default if the code is correct: new warnings are
311311
only emitted when an issue is detected. Effect of the developer mode:
312312
* Add default warning filter, as -W default
313-
* Install debug hooks on memory allocators: see the PyMem_SetupDebugHooks() C function
313+
* Install debug hooks on memory allocators: see the PyMem_SetupDebugHooks()
314+
C function
314315
* Enable the faulthandler module to dump the Python traceback on a crash
315316
* Enable asyncio debug mode
316317
* Set the dev_mode attribute of sys.flags to True
@@ -321,7 +322,19 @@ Set implementation specific option. The following options are available:
321322
otherwise activate automatically). See PYTHONUTF8 for more details
322323

323324
-X pycache_prefix=PATH: enable writing .pyc files to a parallel tree rooted at the
324-
given directory instead of to the code tree.
325+
given directory instead of to the code tree.
326+
327+
-X warn_default_encoding: enable opt-in EncodingWarning for 'encoding=None'
328+
329+
-X no_debug_ranges: disable the inclusion of the tables mapping extra location
330+
information (end line, start column offset and end column offset) to every
331+
instruction in code objects. This is useful when smaller code objects and pyc
332+
files are desired as well as suppressing the extra visual location indicators
333+
when the interpreter displays tracebacks.
334+
335+
-X frozen_modules=[on|off]: whether or not frozen modules should be used
336+
The default is "on" (or "off" if you are running a local build).
337+
325338
.TP
326339
.B \-x
327340
Skip the first line of the source. This is intended for a DOS

Python/initconfig.c

+4-5
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ Options and arguments (and corresponding environment variables):\n\
3838
-d : turn on parser debugging output (for experts only, only works on\n\
3939
debug builds); also PYTHONDEBUG=x\n\
4040
-E : ignore PYTHON* environment variables (such as PYTHONPATH)\n\
41-
-h : print this help message and exit (also --help)\n\
41+
-h : print this help message and exit (also -? or --help)\n\
4242
";
4343
static const char usage_2[] = "\
4444
-i : inspect interactively after running script; forces a prompt even\n\
@@ -65,7 +65,6 @@ static const char usage_3[] = "\
6565
also PYTHONWARNINGS=arg\n\
6666
-x : skip first line of source, allowing use of non-Unix forms of #!cmd\n\
6767
-X opt : set implementation-specific option. The following options are available:\n\
68-
\n\
6968
-X faulthandler: enable faulthandler\n\
7069
-X showrefcount: output the total reference count and number of used\n\
7170
memory blocks when the program finishes or after each statement in the\n\
@@ -82,7 +81,8 @@ static const char usage_3[] = "\
8281
checks which are too expensive to be enabled by default. Effect of the\n\
8382
developer mode:\n\
8483
* Add default warning filter, as -W default\n\
85-
* Install debug hooks on memory allocators: see the PyMem_SetupDebugHooks() C function\n\
84+
* Install debug hooks on memory allocators: see the PyMem_SetupDebugHooks()\n\
85+
C function\n\
8686
* Enable the faulthandler module to dump the Python traceback on a crash\n\
8787
* Enable asyncio debug mode\n\
8888
* Set the dev_mode attribute of sys.flags to True\n\
@@ -100,7 +100,6 @@ static const char usage_3[] = "\
100100
when the interpreter displays tracebacks.\n\
101101
-X frozen_modules=[on|off]: whether or not frozen modules should be used.\n\
102102
The default is \"on\" (or \"off\" if you are running a local build).\n\
103-
\n\
104103
--check-hash-based-pycs always|default|never:\n\
105104
control how Python invalidates hash-based .pyc files\n\
106105
";
@@ -141,7 +140,7 @@ static const char usage_6[] =
141140
"PYTHONNODEBUGRANGES: If this variable is set, it disables the inclusion of the \n"
142141
" tables mapping extra location information (end line, start column offset \n"
143142
" and end column offset) to every instruction in code objects. This is useful \n"
144-
" when smaller cothe de objects and pyc files are desired as well as suppressing the \n"
143+
" when smaller code objects and pyc files are desired as well as suppressing the \n"
145144
" extra visual location indicators when the interpreter displays tracebacks.\n";
146145

147146
#if defined(MS_WINDOWS)

0 commit comments

Comments
 (0)