Skip to content

Commit

Permalink
Merge pull request pypa#10740 from pawelszramowski/explain-unquoted-p…
Browse files Browse the repository at this point in the history
…ip-upgrade-cmd

Explain why using subprocess.list2cmdline is a bad idea
  • Loading branch information
pradyunsg authored Dec 21, 2021
2 parents 5cf9840 + b8c4218 commit 7f8a684
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Empty file.
6 changes: 5 additions & 1 deletion src/pip/_internal/self_outdated_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,11 @@ def pip_self_version_check(session: PipSession, options: optparse.Values) -> Non
# We cannot tell how the current pip is available in the current
# command context, so be pragmatic here and suggest the command
# that's always available. This does not accommodate spaces in
# `sys.executable`.
# `sys.executable` on purpose as it is not possible to do it
# correctly without knowing the user's shell. Thus,
# it won't be done until possible through the standard library.
# Do not be tempted to use the undocumented subprocess.list2cmdline.
# It is considered an internal implementation detail for a reason.
pip_cmd = f"{sys.executable} -m pip"
logger.warning(
"You are using pip version %s; however, version %s is "
Expand Down

0 comments on commit 7f8a684

Please sign in to comment.