Skip to content
Merged
Changes from 1 commit
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
Prev Previous commit
[CLI] Use out.error + Exit(1) instead of CLIError
Avoids the "set HF_DEBUG=1 for full traceback" hint: this is an
instruction to the user, not an internal failure.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
  • Loading branch information
Wauplin and claude committed Sep 7, 2026
commit 22c9cca8c7801d778ef47cdb2bf0d17a6dce2810
4 changes: 2 additions & 2 deletions src/huggingface_hub/cli/system.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import click

from huggingface_hub import __version__, constants
from huggingface_hub.errors import CLIError

from ..utils import dump_environment_info, installation_method
from ._cli_utils import _fetch_latest_pypi_version, run_update
Expand Down Expand Up @@ -53,10 +52,11 @@ def update() -> None:
# way pip refuses to upgrade itself on Windows.
if sys.platform == "win32" and installation_method() == "pip":
command = subprocess.list2cmdline([sys.executable, "-m", "pip", "install", "-U", "huggingface_hub"])
raise CLIError(
out.error(
"On Windows, a pip-installed `hf` cannot update itself: pip is not allowed to replace `hf.exe` while it "
f"is running. Run this command instead:\n {command}"
)
raise click.exceptions.Exit(code=1)

# The standalone installer installs the `hf-cli` skill by default. If it's not installed at this
# point, the user opted out (or removed it): tell the installer to leave it alone instead of
Expand Down
Loading