Remi Delon  committed 8f24c02

Don't lock session file when trying to clean up old session. This is not needed since we're only reading the file and not writing to it.

  • Participants
  • Parent commits aebf7a5
  • Branches default

Comments (0)

Files changed (1)

File cherrypy/filters/

         for fname in os.listdir(storagePath):
             if (fname.startswith(self.SESSION_PREFIX)
                 and not fname.endswith(self.LOCK_SUFFIX)):
-                # We have a session file: lock it, load it and check
-                #   if it's expired
+                # We have a session file: try to load it and check
+                #   if it's expired. If it fails, nevermind.
                 filePath = os.path.join(storagePath, fname)
-                lockFilePath = filePath + self.LOCK_SUFFIX
-                self._lockFile(lockFilePath)
                     f = open(filePath, "rb")
                     data, expirationTime = pickle.load(f)
                         id = fname[len(self.SESSION_PREFIX):]
-                except IOError:
+                except:
                     # We can't access the file ... nevermind
-                self._unlockFile(lockFilePath)
     def _getFilePath(self, id):
         storagePath = cherrypy.config.get('session_filter.storage_path')