changeset 1593:8d3f61d9823f

use .lock extension for file locks
author adam j hartz <hz@mit.edu>
date Mon, 10 Jun 2019 21:45:31 -0400
parents dc3bcbe9da8c
children 2866bd2304b4
files CHANGELOG catsoop/cslog.py
diffstat 2 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/CHANGELOG	Sat Jun 08 23:08:01 2019 -0400
+++ b/CHANGELOG	Mon Jun 10 21:45:31 2019 -0400
@@ -26,6 +26,9 @@
 
 CHANGED:
 
+  * File locks are now stored with a `.lock` extension, to avoid potential
+    collisions with directory names.
+
   * Changed the name of the `util` module to `user` to better reflect its
     purpose.
 
--- a/catsoop/cslog.py	Sat Jun 08 23:08:01 2019 -0400
+++ b/catsoop/cslog.py	Mon Jun 10 21:45:31 2019 -0400
@@ -106,7 +106,7 @@
 
 
 def log_lock(path):
-    lock_loc = os.path.join(base_context.cs_data_root, "_locks", *path)
+    lock_loc = os.path.join(base_context.cs_data_root, "_locks", *path) + '.lock'
     os.makedirs(os.path.dirname(lock_loc), exist_ok=True)
     return FileLock(lock_loc)