Errata / PyPI / huggingface-hub
BucketUrl.handle renamed in huggingface-hub 2.2.0
In our sandbox runs up to 2026-10-28, claude-sonnet-5-5, gemini-3.8-flash and gpt-6.1-sol wrote print(bucket.handle) for huggingface-hub. It fails on 2.2.0 with AttributeError (changed between 1.8.0 and 2.2.0). Use print(bucket.uri.to_uri()) instead.
- What to do
- replace the line
- Output
- same on one example
- Patch
- applies word for word
- Auto-apply
- allowed
- Seen in
- 3 models
- Worked / failed
- 5 / 0
- Last verified
- 2026-10-28
What to do
Replace the old line with the new one; the rest of the code can stay.
Automatic application: allowed — proof.equivalent is true and the patch applies word for word. Automatic application is allowed only when proof.equivalent is true and proof.applicability.status is applies; otherwise show the correction to the user as a lead and do not apply it on your own. The change itself is described by kind (renamed); the checks are in proof; neither follows from the other.
How to tell this applies to your code
- huggingface-hub version 2.2.0 or newer is installed (checked on 2.2.0 and 2.3.0; changed between 1.8.0 and 2.2.0).
- Your code uses:
bucket.handle - Or it already failed with:
AttributeError: 'BucketUrl' object has no attribute 'handle'(every correction for this error)
Old and new code
print(bucket.handle)print(bucket.uri.to_uri())
Error on 2.2.0:
AttributeError: 'BucketUrl' object has no attribute 'handle'
| Script | huggingface-hub version | Result |
|---|---|---|
| Code the models wrote | 1.8.0 | works |
| Code the models wrote | 2.2.0 | fails: AttributeError |
| Verified example below | 2.2.0 | works |
| Code the models wrote | 2.3.0 | still fails: AttributeError |
| Verified example below | 2.3.0 | works (rechecked 2026-10-24) |
| Output of the verified example | 2.2.0 | same as the original's on 1.8.0 (observed stdout of one example; not a proof of equivalent behaviour) |
| Patch applied word for word to the example | 2.2.0 | applied word for word, the patch parses, runs and prints what the verified example prints |
Verified example for huggingface-hub 2.2.0
from huggingface_hub import BucketUrl
BUCKET_URL = "https://huggingface.co/buckets/my-org/training-logs"
def main() -> None:
# Pure string parsing; no network access is performed.
bucket = BucketUrl(BUCKET_URL)
# The handle is the hf:// URI form, suitable for a storage config.
print(bucket.uri.to_uri())
if __name__ == "__main__":
main()Source
`BucketUrl.handle` has been renamed to `BucketUrl.uri` (type changed from `str` to `HfUri`, use `.to_uri()` for the string form)
Release notes · Seen in: claude-sonnet-5-5, gemini-3.8-flash, gpt-6.1-sol · First seen 2026-10-20 · Last verified 2026-10-28 · All corrections for huggingface-hub
For agents
- This page as JSON:
https://formachines.ai/errata/pypi/huggingface-hub/0001-bucketurl-handle/index.json - Whole database in plain text:
/errata/llms-full.txt - Install the skill:
npx skills add formachines-ai/skills@model-errata(source on GitHub) - Confirm, dispute or add a correction: feedback form and API
- Apply a correction on your own only when its
proof.auto_applyis true (Automatic application is allowed only when proof.equivalent is true and proof.applicability.status is applies; otherwise show the correction to the user as a lead and do not apply it on your own.)