Opened 16 years ago

Closed 16 years ago

#9133 closed (wontfix)

Add LockException to locks for completeness

Reported by: magneto Owned by: nobody
Component: File uploads/storage Version: dev
Severity: Keywords: locks
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

in django/core/files/locks.py

All is well, except for the Specific Exception "Resource Unavailable" (IO Error #11) which usually means the file is already locked.

Rather then doing an

except IOError, err:
     if err[0] == 11:
         "Do something with Already Locked"
    else:
        raise

on can simply have a LockException in locks

Not sure if this was a design thought at the beginning, or just a little omission.

This follows from the version on http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/65203

I'm not sure how to do this on windows, perhaps someone else knows?

Attachments (1)

lockexception.diff (1.0 KB ) - added by magneto 16 years ago.
Lock Exception

Download all attachments as: .zip

Change History (4)

by magneto, 16 years ago

Attachment: lockexception.diff added

Lock Exception

comment:1 by magneto, 16 years ago

Has patch: set
milestone: post-1.0

comment:2 by (none), 16 years ago

milestone: post-1.0

Milestone post-1.0 deleted

comment:3 by Jacob, 16 years ago

Resolution: wontfix
Status: newclosed

django.core.files.locks only exists for internal use, which means unless something else in django.core.files needs a change like this, we don't need to make it. Since this isn't needed by the core, there's no reason to make this change.

Note: See TracTickets for help on using tickets.
Back to Top