X-Git-Url: https://git.kaliko.me/?a=blobdiff_plain;f=sima%2Flib%2Fcache.py;h=2640bf01db39101712ad0c6278c878152c2ba923;hb=HEAD;hp=e16ca0e5e2e212ab839bced62415496a5a653f5b;hpb=8bf0d37a99b80af5674a639bfbc155db18ac557d;p=mpd-sima.git diff --git a/sima/lib/cache.py b/sima/lib/cache.py index e16ca0e..2640bf0 100644 --- a/sima/lib/cache.py +++ b/sima/lib/cache.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -# Copyright (c) 2014 Jack Kaliko +# Copyright (c) 2014, 2021 kaliko # Copyright (c) 2012, 2013 Eric Larson # # This program is free software: you can redistribute it and/or modify @@ -73,7 +73,7 @@ class FileCache: self.forever = forever if not os.path.isdir(self.directory): - os.makedirs(self.directory) + os.makedirs(self.directory, mode=0o755) def encode(self, val): return md5(val.encode('utf-8')).hexdigest() @@ -85,6 +85,7 @@ class FileCache: name = self._fn(key) if os.path.exists(name): return load(codecs.open(name, 'rb')) + return None def set(self, key, value): name = self._fn(key)