Author: mtredinnick
Date: 2008-08-28 14:28:45 -0500 (Thu, 28 Aug 2008)
New Revision: 8675

Modified:
   django/trunk/django/core/files/locks.py
Log:
Fixed #8403 -- Changed the use of fcntl.flock() to fcntl.lockf(). On some
systems, this will ensure fnctl-based file locking is always used, which means
locking of NFS-mounted files should work.


Modified: django/trunk/django/core/files/locks.py
===================================================================
--- django/trunk/django/core/files/locks.py     2008-08-28 19:28:31 UTC (rev 
8674)
+++ django/trunk/django/core/files/locks.py     2008-08-28 19:28:45 UTC (rev 
8675)
@@ -54,10 +54,10 @@
         win32file.UnlockFileEx(hfile, 0, -0x10000, __overlapped)
 elif system_type == 'posix':
     def lock(file, flags):
-        fcntl.flock(fd(file), flags)
+        fcntl.lockf(fd(file), flags)
 
     def unlock(file):
-        fcntl.flock(fd(file), fcntl.LOCK_UN)
+        fcntl.lockf(fd(file), fcntl.LOCK_UN)
 else:
     # File locking is not supported.
     LOCK_EX = LOCK_SH = LOCK_NB = None


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to