﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
9433	File locking broken on AFP mounts	rndblnch	anonymous	"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
>>> django.VERSION
(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
    fcntl.lockf(fd(file), flags)
IOError: [Errno 45] Operation not supported
}}}

A workaround is to revert [8675].
I know this is not acceptable since it fixes #8403, but it is still a fact that from a Mac OS X user perspective, [8675] introduce a regression.
"	Bug	closed	File uploads/storage	dev	Normal	fixed			Accepted	1	0	0	0	0	0
