Skip to content
Merged
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
13 changes: 9 additions & 4 deletions src/click/_termui_impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -429,8 +429,11 @@ def _pipepager(
cmd_filepath = shutil.which(cmd)
if not cmd_filepath:
return False
# Resolves symlinks and produces a normalized absolute path string.
cmd_path = Path(cmd_filepath).resolve()

# Produces a normalized absolute path string.
# multi-call binaries such as busybox derive their identity from the symlink
# less -> busybox. resolve() causes them to misbehave. (eg. less becomes busybox)
cmd_path = Path(cmd_filepath).absolute()
cmd_name = cmd_path.name

import subprocess
Expand Down Expand Up @@ -520,8 +523,10 @@ def _tempfilepager(
cmd_filepath = shutil.which(cmd)
if not cmd_filepath:
return False
# Resolves symlinks and produces a normalized absolute path string.
cmd_path = Path(cmd_filepath).resolve()
# Produces a normalized absolute path string.
# multi-call binaries such as busybox derive their identity from the symlink
# less -> busybox. resolve() causes them to misbehave. (eg. less becomes busybox)
cmd_path = Path(cmd_filepath).absolute()

import subprocess
import tempfile
Expand Down