Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
15 commits
Select commit Hold shift + click to select a range
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
Next Next commit
[Download] Extend tmp .incomplete path on Windows when too long (#4978)
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
  • Loading branch information
Wauplin and claude authored Sep 23, 2026
commit 0f88f3220035c590c30594faec5cc92953bd4611
2 changes: 2 additions & 0 deletions src/huggingface_hub/file_download.py
Original file line number Diff line number Diff line change
Expand Up @@ -1999,7 +1999,9 @@ def _download_to_tmp_and_move(
# process, a broken lock costs only duplicated bandwidth: each process downloads the full
# file and atomically renames it to the final destination.
# See https://github.com/huggingface/huggingface_hub/pull/4228.
# Re-check the length on Windows: the suffix can push a path just under the limit above MAX_PATH.
tmp_path = incomplete_path.with_name(f"{incomplete_path.stem}.{uuid.uuid4().hex[:8]}.incomplete")
tmp_path = Path(as_extended_path(tmp_path))
try:
with tmp_path.open("wb") as f:
logger.debug(f"Downloading '{filename}' to '{tmp_path}'")
Expand Down
Loading