Skip to content

Commit ed740c3

Browse files
authored
bug fix: only extend path on window sys (#3265)
1 parent 8b9f446 commit ed740c3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/huggingface_hub/_local_folder.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ def incomplete_path(self, etag: str) -> Path:
9090
resolved_path = str(path.resolve())
9191
# Some Windows versions do not allow for paths longer than 255 characters.
9292
# In this case, we must specify it as an extended path by using the "\\?\" prefix.
93-
if len(resolved_path) > 255 and not resolved_path.startswith("\\\\?\\"):
93+
if os.name == "nt" and len(resolved_path) > 255 and not resolved_path.startswith("\\\\?\\"):
9494
path = Path("\\\\?\\" + resolved_path)
9595
return path
9696

0 commit comments

Comments
 (0)