diff --git a/upath/core.py b/upath/core.py index a8a72669..72017bc1 100644 --- a/upath/core.py +++ b/upath/core.py @@ -1755,7 +1755,10 @@ def touch(self, mode: int = 0o666, exist_ok: bool = True) -> None: if exists and not exist_ok: raise FileExistsError(str(self)) if not exists: - self.fs.touch(self.path, truncate=True) + try: + self.fs.touch(self.path, truncate=True) + except NotImplementedError: + _raise_unsupported(type(self).__name__, "touch") else: try: self.fs.touch(self.path, truncate=False)