Skip to content

Fix copy file to folder#4075

Merged
Wauplin merged 1 commit intomainfrom
fix-copy-file-to-folder
Apr 9, 2026
Merged

Fix copy file to folder#4075
Wauplin merged 1 commit intomainfrom
fix-copy-file-to-folder

Conversation

@Wauplin
Copy link
Copy Markdown
Contributor

@Wauplin Wauplin commented Apr 9, 2026

Follow-up after #3874.

Fixes test_copy_files_file_to_folder_dest in CI.

hf buckets cp hf://buckets/{bucket_write}/source.txt hf://buckets/{bucket_write_2}/folder/

should copy file under /folder/source.txt even if folder/ folder doesn't exist yet.

Will make a patch release once it's merged.


Note

Low Risk
Low risk: a small change to destination path interpretation for bucket copies; main risk is minor behavior change for paths ending in / that previously could be treated as files.

Overview
Fixes copy_files bucket copy behavior so a destination explicitly ending with / is always treated as a directory target.

This ensures copying a single file to a non-existent folder path like hf://buckets/.../folder/ places the file under that folder (e.g. folder/source.txt) instead of attempting to treat the destination as a file path.

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

@Wauplin Wauplin requested a review from hanouticelina April 9, 2026 13:40
@bot-ci-comment
Copy link
Copy Markdown

bot-ci-comment Bot commented Apr 9, 2026

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@Wauplin Wauplin merged commit b6a3078 into main Apr 9, 2026
15 of 21 checks passed
@Wauplin Wauplin deleted the fix-copy-file-to-folder branch April 9, 2026 14:21
Wauplin added a commit that referenced this pull request Apr 9, 2026
@huggingface-hub-bot
Copy link
Copy Markdown
Contributor

This PR has been shipped as part of the v1.10.1 release.

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