File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- v18.2.0dev
2- ----------
1+ v18.2.0
2+ -------
3+
4+ * File-based sessions no longer attempt to remove the lock files
5+ when releasing locks, instead deferring to the default behavior
6+ of zc.lockfile. Fixes :issue: `1391 ` and :issue: `1779 `.
37
48* :pr: `1794 `: Add native support for ``308 Permanent Redirect ``
59 usable via ``raise cherrypy.HTTPRedirect('/new_uri', 308) ``.
Original file line number Diff line number Diff line change 107107import threading
108108import binascii
109109import pickle
110- import contextlib
111110
112111import zc .lockfile
113112
@@ -566,8 +565,6 @@ def acquire_lock(self, path=None):
566565 def release_lock (self , path = None ):
567566 """Release the lock on the currently-loaded session data."""
568567 self .lock .close ()
569- with contextlib .suppress (FileNotFoundError ):
570- os .remove (self .lock ._path )
571568 self .locked = False
572569
573570 def clean_up (self ):
Original file line number Diff line number Diff line change @@ -222,7 +222,7 @@ def f():
222222 return [
223223 x
224224 for x in os .listdir (localDir )
225- if x .startswith ('session-' )
225+ if x .startswith ('session-' ) and not x . endswith ( '.lock' )
226226 ]
227227 assert f () == []
228228
@@ -236,7 +236,6 @@ def test_1_Ram_Concurrency(self):
236236 self .getPage ('/set_session_cls/cherrypy.lib.sessions.RamSession' )
237237 self ._test_Concurrency ()
238238
239- @pytest .mark .xfail (reason = '#1306' )
240239 def test_2_File_Concurrency (self ):
241240 self .getPage ('/set_session_cls/cherrypy.lib.sessions.FileSession' )
242241 self ._test_Concurrency ()
You can’t perform that action at this time.
0 commit comments