-
Notifications
You must be signed in to change notification settings - Fork 50
Open
Labels
bug 🐛Something isn't workingSomething isn't working
Description
Description
ProxyUPath._copy_from() has a fixed signature that only accepts follow_symlinks, but newer versions of fsspec pass additional keyword arguments like preserve_metadata. This causes a TypeError when using move() or copy() with a ProxyUPath subclass as the destination.
MWE
from upath import UPath
from upath.extensions import ProxyUPath
class MyProxyPath(ProxyUPath):
def __init__(self, path):
self._lazy = UPath(path)
@property
def __wrapped__(self):
return self._lazy
@classmethod
def _from_upath(cls, upath, /):
obj = object.__new__(cls)
obj._lazy = upath
return obj
# Local file to S3 (or any cross-filesystem move)
source = UPath("/tmp/test.txt")
source.write_text("hello")
destination = MyProxyPath("s3://my-bucket/test.txt")
source.move(destination) # TypeError: ProxyUPath._copy_from() got an unexpected keyword argument 'preserve_metadata'
Expected Behavior
_copy_from() should forward all kwargs to the wrapped UPath:
def _copy_from(
self, source: ReadablePath | Self, follow_symlinks: bool = True, **kwargs
) -> None:
self.__wrapped__._copy_from(source, follow_symlinks=follow_symlinks, **kwargs)
Environment
Python: 3.14
universal-pathlib: 0.3.9
fsspec: 2026.2
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bug 🐛Something isn't workingSomething isn't working