diff --git a/radicale/storage/multifilesystem/base.py b/radicale/storage/multifilesystem/base.py index c2257b34..bbb02198 100644 --- a/radicale/storage/multifilesystem/base.py +++ b/radicale/storage/multifilesystem/base.py @@ -45,7 +45,7 @@ class CollectionBase(storage.BaseCollection): self._filesystem_path = filesystem_path # TODO: better fix for "mypy" - @types.contextmanager # type: ignore + @types.contextmanager # type: ignore def _atomic_write(self, path: str, mode: str = "w", newline: Optional[str] = None) -> Iterator[IO[AnyStr]]: # TODO: Overload with Literal when dropping support for Python < 3.8 diff --git a/radicale/storage/multifilesystem/cache.py b/radicale/storage/multifilesystem/cache.py index fc6b10f6..31ab4715 100644 --- a/radicale/storage/multifilesystem/cache.py +++ b/radicale/storage/multifilesystem/cache.py @@ -87,7 +87,7 @@ class CollectionPartCache(CollectionBase): self._storage._makedirs_synced(cache_folder) # Race: Other processes might have created and locked the file. # TODO: better fix for "mypy" - with contextlib.suppress(PermissionError), self._atomic_write( # type: ignore + with contextlib.suppress(PermissionError), self._atomic_write( # type: ignore os.path.join(cache_folder, href), "wb") as fo: fb = cast(BinaryIO, fo) pickle.dump((cache_hash, *content), fb) diff --git a/radicale/storage/multifilesystem/meta.py b/radicale/storage/multifilesystem/meta.py index 577bfa14..b95fb162 100644 --- a/radicale/storage/multifilesystem/meta.py +++ b/radicale/storage/multifilesystem/meta.py @@ -62,6 +62,6 @@ class CollectionPartMeta(CollectionBase): def set_meta(self, props: Mapping[str, str]) -> None: # TODO: better fix for "mypy" - with self._atomic_write(self._props_path, "w") as fo: # type: ignore + with self._atomic_write(self._props_path, "w") as fo: # type: ignore f = cast(TextIO, fo) json.dump(props, f, sort_keys=True) diff --git a/radicale/storage/multifilesystem/sync.py b/radicale/storage/multifilesystem/sync.py index 7f2f8223..ae703c91 100644 --- a/radicale/storage/multifilesystem/sync.py +++ b/radicale/storage/multifilesystem/sync.py @@ -96,7 +96,7 @@ class CollectionPartSync(CollectionPartCache, CollectionPartHistory, try: # Race: Other processes might have created and locked the file. # TODO: better fix for "mypy" - with self._atomic_write(token_path, "wb") as fo: # type: ignore + with self._atomic_write(token_path, "wb") as fo: # type: ignore fb = cast(BinaryIO, fo) pickle.dump(state, fb) except PermissionError: diff --git a/radicale/storage/multifilesystem/upload.py b/radicale/storage/multifilesystem/upload.py index 58a2a5e1..a9fcdc2c 100644 --- a/radicale/storage/multifilesystem/upload.py +++ b/radicale/storage/multifilesystem/upload.py @@ -44,7 +44,7 @@ class CollectionPartUpload(CollectionPartGet, CollectionPartCache, (href, self.path, e)) from e path = pathutils.path_to_filesystem(self._filesystem_path, href) # TODO: better fix for "mypy" - with self._atomic_write(path, newline="") as fo: # type: ignore + with self._atomic_write(path, newline="") as fo: # type: ignore f = cast(TextIO, fo) f.write(item.serialize()) # Clean the cache after the actual item is stored, or the cache entry