Opened 17 years ago
Closed 17 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)
Change History (4)
by , 17 years ago
| Attachment: | lockexception.diff added |
|---|
comment:1 by , 17 years ago
| Has patch: | set |
|---|---|
| milestone: | → post-1.0 |
comment:3 by , 17 years ago
| Resolution: | → wontfix |
|---|---|
| Status: | new → closed |
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.
Lock Exception