From 184e5b957b5a9835581a66acc28cd1d268a17586 Mon Sep 17 00:00:00 2001 From: fpeters <> Date: Sat, 17 Apr 2004 20:23:02 +0000 Subject: [PATCH] =?UTF-8?q?ne=20panique=20pas=20si=20le=20r=C3=A9pertoire?= =?UTF-8?q?=20webcache=20ne=20peut=20=C3=AAtre=20cr=C3=A9=C3=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- glasnost-web/code/webhandler.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) 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))