paulb@17 | 1 | --- Application.py Wed Jan 22 10:03:25 2003 |
paulb@17 | 2 | +++ Application.py Sun Feb 1 18:03:03 2004 |
paulb@17 | 3 | @@ -389,7 +389,10 @@ |
paulb@17 | 4 | try: |
paulb@17 | 5 | ssPath = request.serverSidePath() |
paulb@17 | 6 | if ssPath is None or not os.path.exists(ssPath): |
paulb@17 | 7 | - self.handleBadURL(transaction) |
paulb@17 | 8 | + try: |
paulb@17 | 9 | + self.handleGoodURL(transaction) |
paulb@17 | 10 | + except Exception, exc: |
paulb@17 | 11 | + self.handleBadURL(transaction) |
paulb@17 | 12 | elif isdir(ssPath) and noslash(request.pathInfo()): # (*) see below |
paulb@17 | 13 | self.handleDeficientDirectoryURL(transaction) |
paulb@17 | 14 | elif self.isSessionIdProblematic(request): |
paulb@17 | 15 | @@ -1030,7 +1033,7 @@ |
paulb@17 | 16 | cache = self._servletCacheByPath.get(path, None) |
paulb@17 | 17 | |
paulb@17 | 18 | # File is not newer? |
paulb@17 | 19 | - if cache and cache['timestamp']<os.path.getmtime(path): |
paulb@17 | 20 | + if cache and cache.has_key('timestamp') and cache['timestamp']<os.path.getmtime(path): |
paulb@17 | 21 | cache['instances'][:] = [] |
paulb@17 | 22 | cache = None |
paulb@17 | 23 | |
paulb@17 | 24 | @@ -1038,11 +1041,15 @@ |
paulb@17 | 25 | cache = { |
paulb@17 | 26 | 'instances': [], |
paulb@17 | 27 | 'path': path, |
paulb@17 | 28 | - 'timestamp': os.path.getmtime(path), |
paulb@17 | 29 | 'threadsafe': 0, |
paulb@17 | 30 | 'reuseable': 0, |
paulb@17 | 31 | } |
paulb@17 | 32 | |
paulb@17 | 33 | + try: |
paulb@17 | 34 | + cache['timestamp'] = os.path.getmtime(path) |
paulb@17 | 35 | + except OSError: |
paulb@17 | 36 | + pass |
paulb@17 | 37 | + |
paulb@17 | 38 | self.newServletCacheItem(path,cache) |
paulb@17 | 39 | inst = self.getServlet(transaction,path,cache) |
paulb@17 | 40 | |
paulb@17 | 41 | @@ -1284,8 +1291,8 @@ |
paulb@17 | 42 | else: |
paulb@17 | 43 | return None, None, None |
paulb@17 | 44 | |
paulb@17 | 45 | - elif not os.path.isfile(ssPath): |
paulb@17 | 46 | - return None, None, None |
paulb@17 | 47 | + #elif not os.path.isfile(ssPath): |
paulb@17 | 48 | + # return None, None, None |
paulb@17 | 49 | |
paulb@17 | 50 | self._serverSideInfoCacheByPath[urlPath] = ssPath, contextPath, contextName |
paulb@17 | 51 | |