diff --git a/glasnost-web/code/webhandler.py b/glasnost-web/code/webhandler.py index 5cb0e112..588dca82 100644 --- a/glasnost-web/code/webhandler.py +++ b/glasnost-web/code/webhandler.py @@ -591,11 +591,12 @@ class Application(applications.Application): # Handle web cache. reqCache = None if sessionToken is None: - reqCache = RequestCache(req, languages[0]) + try: + reqCache = RequestCache(req, languages[0]) + except OSError: + reqCache = None reqCache.cacheTime = context.getVar('cacheTime') if not virtualHost.cacheFiles: - reqCache.caching = -1 - modTime = reqCache.checkDepends() reqCache = None else: req.headers_out['Expires'] = reqCache.getExpires() @@ -1318,7 +1319,11 @@ class RequestCache: context.getVar('varDirectoryPath'), 'webcache', context.getVar('virtualHost').hostName) if not os.path.exists(self.cacheDirectoryPath): - os.mkdir(self.cacheDirectoryPath) + try: + os.mkdir(self.cacheDirectoryPath) + except OSError: + return + self.cacheFilePath = os.path.join( self.cacheDirectoryPath, self.getCacheFileName(language))