Skip to content

Commit aba2e7a

Browse files
Fix issue with directory paths in local store
1 parent d2a0d03 commit aba2e7a

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

  • tilebox-workflows/tilebox/workflows

tilebox-workflows/tilebox/workflows/cache.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
from botocore.exceptions import ClientError
1111
from google.cloud.exceptions import NotFound
1212
from google.cloud.storage import Blob, Bucket
13+
from obstore.exceptions import GenericError
1314
from obstore.store import ObjectStore
1415

1516

@@ -100,7 +101,9 @@ def __getitem__(self, key: str) -> bytes:
100101
try:
101102
entry = self.store.get(str(self.prefix / key))
102103
return bytes(entry.bytes())
103-
except OSError:
104+
except (OSError, GenericError):
105+
# GenericError is raised if the key contains separator characters, but one of the parents is a file
106+
# instead of a directory
104107
raise KeyError(f"{key} is not cached!") from None
105108

106109
def __iter__(self) -> Iterator[str]:

0 commit comments

Comments
 (0)