diff options
| -rw-r--r-- | CHANGES.rst | 8 | ||||
| -rw-r--r-- | cherrypy/lib/sessions.py | 3 | ||||
| -rwxr-xr-x | cherrypy/test/test_session.py | 3 |
3 files changed, 7 insertions, 7 deletions
diff --git a/CHANGES.rst b/CHANGES.rst index c44303a9..b205a85d 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1,5 +1,9 @@ -v18.2.0dev ----------- +v18.2.0 +------- + +* File-based sessions no longer attempt to remove the lock files + when releasing locks, instead deferring to the default behavior + of zc.lockfile. Fixes :issue:`1391` and :issue:`1779`. * :pr:`1794`: Add native support for ``308 Permanent Redirect`` usable via ``raise cherrypy.HTTPRedirect('/new_uri', 308)``. diff --git a/cherrypy/lib/sessions.py b/cherrypy/lib/sessions.py index f7286708..5b3328f2 100644 --- a/cherrypy/lib/sessions.py +++ b/cherrypy/lib/sessions.py @@ -107,7 +107,6 @@ import time import threading import binascii import pickle -import contextlib import zc.lockfile @@ -566,8 +565,6 @@ class FileSession(Session): def release_lock(self, path=None): """Release the lock on the currently-loaded session data.""" self.lock.close() - with contextlib.suppress(FileNotFoundError): - os.remove(self.lock._path) self.locked = False def clean_up(self): diff --git a/cherrypy/test/test_session.py b/cherrypy/test/test_session.py index 0d82a304..2d869e4b 100755 --- a/cherrypy/test/test_session.py +++ b/cherrypy/test/test_session.py @@ -222,7 +222,7 @@ class SessionTest(helper.CPWebCase): return [ x for x in os.listdir(localDir) - if x.startswith('session-') + if x.startswith('session-') and not x.endswith('.lock') ] assert f() == [] @@ -236,7 +236,6 @@ class SessionTest(helper.CPWebCase): self.getPage('/set_session_cls/cherrypy.lib.sessions.RamSession') self._test_Concurrency() - @pytest.mark.xfail(reason='#1306') def test_2_File_Concurrency(self): self.getPage('/set_session_cls/cherrypy.lib.sessions.FileSession') self._test_Concurrency() |
