commit ee6820ef608f8e642093546a444f238f57a2bb60
parent 1951fcda8a1a434f555699c2a8f5fac76f059f3a
Author: lash <dev@holbrook.no>
Date: Thu, 5 May 2022 15:44:41 +0000
Handle missing files in filesystem store list
Diffstat:
3 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/CHANGELOG b/CHANGELOG
@@ -1,3 +1,5 @@
+- 0.2.7
+ * Handle missing files in fs readdir list
- 0.2.6
* Ensure atomic state lock in fs
- 0.2.5
diff --git a/setup.cfg b/setup.cfg
@@ -1,6 +1,6 @@
[metadata]
name = shep
-version = 0.2.6
+version = 0.2.7
description = Multi-state key stores using bit masks
author = Louis Holbrook
author_email = dev@holbrook.no
diff --git a/shep/store/file.py b/shep/store/file.py
@@ -115,7 +115,11 @@ class SimpleFileStore:
files = []
for p in os.listdir(self.__path):
fp = os.path.join(self.__path, p)
- f = open(fp, self.__m[0])
+ f = None
+ try:
+ f = open(fp, self.__m[0])
+ except FileNotFoundError:
+ continue
r = f.read()
f.close()
if len(r) == 0: