Skip to content

[3.13] gh-133512: Adds warnings to py.exe launcher about subcommands belonging to Python install manager #133514

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Add warnings to :ref:`launcher` about use of subcommands belonging to the
Python install manager.
17 changes: 16 additions & 1 deletion PC/launcher2.c
Original file line number Diff line number Diff line change
Expand Up @@ -1058,7 +1058,7 @@ checkShebang(SearchInfo *search)
debug(L"# Failed to open %s for shebang parsing (0x%08X)\n",
scriptFile, GetLastError());
free(scriptFile);
return 0;
return RC_NO_SCRIPT;
}

DWORD bytesRead = 0;
Expand Down Expand Up @@ -2665,6 +2665,21 @@ performSearch(SearchInfo *search, EnvironmentInfo **envs)
case RC_NO_SHEBANG:
case RC_RECURSIVE_SHEBANG:
break;
case RC_NO_SCRIPT:
if (!_comparePath(search->scriptFile, search->scriptFileLength, L"install", -1) ||
!_comparePath(search->scriptFile, search->scriptFileLength, L"uninstall", -1) ||
!_comparePath(search->scriptFile, search->scriptFileLength, L"list", -1) ||
!_comparePath(search->scriptFile, search->scriptFileLength, L"help", -1)) {
fprintf(
stderr,
"WARNING: The '%.*ls' command is unavailable because this is the legacy py.exe command.\n"
"If you have already installed the Python install manager, open Installed Apps and "
"remove 'Python Launcher' to enable the new py.exe command.\n",
search->scriptFileLength,
search->scriptFile
);
}
break;
default:
return exitCode;
}
Expand Down
Loading