Skip to content

upath.core: fix rename() of directories - #575

Merged
ap-- merged 3 commits into
fsspec:mainfrom
ap--:fix-rename-directories
Nov 10, 2026
Merged

ap-- merged 3 commits into
fsspec:mainfrom
ap--:fix-rename-directories

Conversation

@ap--

@ap-- ap-- commented Nov 10, 2026

Copy link
Copy Markdown
Collaborator

UPath.rename() called fs.mv() without recursive=True unless the deprecated keyword argument was passed, so renaming a directory raised on memory:// and silently moved nothing on s3:// while returning the target path. Directory sources are now moved recursively.

With fsspec>=2026.6.0 AbstractFileSystem.mv(recursive=True) fails on object stores because copying the pseudo-directory key raises, so the s3 test is marked xfail for those versions.

ap-- added 2 commits November 8, 2026 19:33
UPath.rename() called fs.mv() without recursive=True unless the deprecated
keyword argument was passed, so renaming a directory raised on memory://
and silently moved nothing on s3:// while returning the target path.
Directory sources are now moved recursively.

With fsspec>=2026.6.0 AbstractFileSystem.mv(recursive=True) fails on
object stores because copying the pseudo-directory key raises, so the s3
test is marked xfail for those versions.
SFTPFileSystem.mv(old, new) does a native rename that already handles
directories and raises TypeError on the injected recursive=True. Also
mark the azure rename directory test xfail for fsspec>=2026.6.0 for the
same pseudo-directory reason as on s3.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@ap--
ap-- merged commit 47eafa0 into fsspec:main Nov 10, 2026
31 checks passed
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.

1 participant