Skip to content

Commit 7f8a684

Browse files
authored
Merge pull request #10740 from pawelszramowski/explain-unquoted-pip-upgrade-cmd
Explain why using subprocess.list2cmdline is a bad idea
2 parents 5cf9840 + b8c4218 commit 7f8a684

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

news/eb0afbc2-59df-40a3-b7bd-325305c3e2e7.trivial.rst

Whitespace-only changes.

src/pip/_internal/self_outdated_check.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,11 @@ def pip_self_version_check(session: PipSession, options: optparse.Values) -> Non
165165
# We cannot tell how the current pip is available in the current
166166
# command context, so be pragmatic here and suggest the command
167167
# that's always available. This does not accommodate spaces in
168-
# `sys.executable`.
168+
# `sys.executable` on purpose as it is not possible to do it
169+
# correctly without knowing the user's shell. Thus,
170+
# it won't be done until possible through the standard library.
171+
# Do not be tempted to use the undocumented subprocess.list2cmdline.
172+
# It is considered an internal implementation detail for a reason.
169173
pip_cmd = f"{sys.executable} -m pip"
170174
logger.warning(
171175
"You are using pip version %s; however, version %s is "

0 commit comments

Comments
 (0)