formachines / errata

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

Old and new code

print(bucket.handle)
print(bucket.uri.to_uri())

Error on 2.2.0:

AttributeError: 'BucketUrl' object has no attribute 'handle'
Sandbox proof
Scripthuggingface-hub versionResult
Code the models wrote1.8.0works
Code the models wrote2.2.0fails: AttributeError
Verified example below2.2.0works
Code the models wrote2.3.0still fails: AttributeError
Verified example below2.3.0works (rechecked 2026-10-24)
Output of the verified example2.2.0same 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 example2.2.0applied 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