From 29f9a1076697dbfb375f26e89ada1b85bd62f5d1 Mon Sep 17 00:00:00 2001 From: Markus Unterwaditzer Date: Sun, 30 Nov 2014 16:02:01 +0100 Subject: [PATCH] Skip non-directories during filesystem discovery --- vdirsyncer/storage/filesystem.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/vdirsyncer/storage/filesystem.py b/vdirsyncer/storage/filesystem.py index b21bdf9..69f4f2d 100644 --- a/vdirsyncer/storage/filesystem.py +++ b/vdirsyncer/storage/filesystem.py @@ -54,8 +54,9 @@ class FilesystemStorage(Storage): raise TypeError('collection argument must not be given.') path = expand_path(path) for collection in os.listdir(path): - s = cls(path=path, collection=collection, **kwargs) - yield s + if os.path.isdir(os.path.join(path, collection)): + s = cls(path=path, collection=collection, **kwargs) + yield s def _get_filepath(self, href): return os.path.join(self.path, href)