File locking does not work on volumes mounted using AFP on Mac OS X 10.5
django/core/files/locks.py assumes that the presence of fcntl module implies a posix system and that for a posix system fcntl.lockf works for every file accessible on the file system.
This is not the case on a Mac OS X box for files on a volume mounted using AFP:
[taquet:~] iihm% uname -mprs
Darwin 9.5.0 Power Macintosh powerpc
[taquet:~] iihm% python
Python 2.5.1 (r251:54863, Jan 17 2008, 19:35:16)
[GCC 4.0.1 (Apple Inc. build 5465)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import django
(1, 0, 'final')
>>> from django.core.files import locks
>>> f = open("/Volumes/Web/test.txt", "w")
>>> locks.lock(f, locks.LOCK_EX)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Library/Python/2.5/site-packages/django/core/files/locks.py", line 57, in lock
IOError: [Errno 45] Operation not supported
A workaround is to revert .
I know this is not acceptable since it fixes #8403, but it is still a fact that from a Mac OS X user perspective,  introduce a regression.