#9433: File locking broken on AFP mounts ----------------------------------+----------------------------------------- Reporter: rndblnch | Owner: nobody Status: new | Milestone: Component: File uploads/storage | Version: 1.0 Keywords: | Stage: Unreviewed Has_patch: 0 | ----------------------------------+----------------------------------------- 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. -- Ticket URL: <http://code.djangoproject.com/ticket/9433> Django <http://code.djangoproject.com/> The Web framework for perfectionists with deadlines. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django updates" group. To post to this group, send email to django-updates@googlegroups.com 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 -~----------~----~----~----~------~----~------~--~---