Fix misleading max_retries docstring in http_backoff by Sreekant13 · Pull Request #4436 · huggingface/huggingface_hub · GitHub
Skip to content

Fix misleading max_retries docstring in http_backoff#4436

Merged
Wauplin merged 1 commit into
huggingface:mainfrom
Sreekant13:docs/http-backoff-retries
Jun 29, 2026
Merged

Fix misleading max_retries docstring in http_backoff#4436
Wauplin merged 1 commit into
huggingface:mainfrom
Sreekant13:docs/http-backoff-retries

Conversation

@Sreekant13

@Sreekant13 Sreekant13 commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Small docs fix. The max_retries docstring in http_backoff and http_stream_backoff says it "defaults to 5 (no retries)", which doesn't add up - 5 means 5 retries, not none. Looks like a leftover from when the default used
to be 0. I updated both to say the default is 5, and to mention you can pass 0 if you actually want to turn retries off.


Note

Low Risk
Documentation-only change with no runtime behavior impact.

Overview
Corrects the max_retries argument documentation on http_backoff and http_stream_backoff in _http.py.

The old text claimed the default is 5 while also saying “(no retries)”, which contradicts the implementation (default 5 retries, 0 disables retries). Both docstrings now state that the default is 5 and that max_retries=0 turns retries off.

Reviewed by Cursor Bugbot for commit b1a325c. Bugbot is set up for automated code reviews on this repo. Configure here.

@Wauplin Wauplin left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch!

@Wauplin Wauplin merged commit 7f953bf into huggingface:main Jun 29, 2026
1 check passed
@Sreekant13 Sreekant13 deleted the docs/http-backoff-retries branch June 29, 2026 08:06
@Sreekant13

Copy link
Copy Markdown
Contributor Author

@huggingface-hub-bot

Copy link
Copy Markdown
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants