Code

Opened 6 years ago

Closed 5 years ago

#9133 closed (wontfix)

Add LockException to locks for completeness

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

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 6 years ago.
Lock Exception

Download all attachments as: .zip

Change History (4)

Changed 6 years ago by magneto

Lock Exception

comment:1 Changed 6 years ago by magneto

  • Has patch set
  • milestone set to post-1.0
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

comment:2 Changed 5 years ago by anonymous

  • milestone post-1.0 deleted

Milestone post-1.0 deleted

comment:3 Changed 5 years ago by jacob

  • Resolution set to wontfix
  • Status changed from new to 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.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.