Skip to content

Commit b3e6783

Browse files
authored
bpo-37556 Extend help to include latest overrides (GH-14701)
Modify the help in cpython/PC/launcher.c to show users that "latest" can be overridden by shebang, PY_PYTHON[n] or py.ini files. Also show that script [args] is optional by enclosing in square brackets. Automerge-Triggered-By: @zooba
1 parent a6ac239 commit b3e6783

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Extend py.exe help to mention overrides via venv, shebang, environmental variables & ini files.

PC/launcher.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1520,7 +1520,7 @@ show_help_text(wchar_t ** argv)
15201520
Python Launcher for Windows Version %ls\n\n", version_text);
15211521
fwprintf(stdout, L"\
15221522
usage:\n\
1523-
%ls [launcher-args] [python-args] script [script-args]\n\n", argv[0]);
1523+
%ls [launcher-args] [python-args] [script [script-args]]\n\n", argv[0]);
15241524
fputws(L"\
15251525
Launcher arguments:\n\n\
15261526
-2 : Launch the latest Python 2.x version\n\
@@ -1536,6 +1536,15 @@ Launcher arguments:\n\n\
15361536
}
15371537
fputws(L"\n-0 --list : List the available pythons", stdout);
15381538
fputws(L"\n-0p --list-paths : List with paths", stdout);
1539+
fputws(L"\n\n If no script is specified the specified interpreter is opened.", stdout);
1540+
fputws(L"\nIf an exact version is not given, using the latest version can be overridden by", stdout);
1541+
fputws(L"\nany of the following, (in priority order):", stdout);
1542+
fputws(L"\n An active virtual environment", stdout);
1543+
fputws(L"\n A shebang line in the script (if present)", stdout);
1544+
fputws(L"\n With -2 or -3 flag a matching PY_PYTHON2 or PY_PYTHON3 Enviroment variable", stdout);
1545+
fputws(L"\n A PY_PYTHON Enviroment variable", stdout);
1546+
fputws(L"\n From [defaults] in py.ini in your %LOCALAPPDATA%\\py.ini", stdout);
1547+
fputws(L"\n From [defaults] in py.ini beside py.exe (use `where py` to locate)", stdout);
15391548
fputws(L"\n\nThe following help text is from Python:\n\n", stdout);
15401549
fflush(stdout);
15411550
}

0 commit comments

Comments
 (0)