From 439e63f8eab65aeca68f398ca2898e5de09e0de5 Mon Sep 17 00:00:00 2001 From: Bernhard Reiter Date: Wed, 19 May 2021 17:51:57 +0200 Subject: [PATCH] Make /storage/filesystem ignore `.tmp` files Hardcode to ignore files with `.tmp` suffix as this is mentioned in the vdir specification. --- vdirsyncer/storage/filesystem.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vdirsyncer/storage/filesystem.py b/vdirsyncer/storage/filesystem.py index 352e59c..1e47ba1 100644 --- a/vdirsyncer/storage/filesystem.py +++ b/vdirsyncer/storage/filesystem.py @@ -80,7 +80,8 @@ class FilesystemStorage(Storage): def list(self): for fname in os.listdir(self.path): fpath = os.path.join(self.path, fname) - if os.path.isfile(fpath) and fname.endswith(self.fileext): + if os.path.isfile(fpath) and fname.endswith(self.fileext) and ( + not fname.endswith('.tmp')): yield fname, get_etag_from_file(fpath) def get(self, href):