Opened 9 years ago
Closed 9 years ago
#26691 closed Cleanup/optimization (fixed)
Don't check for a file's existence before deleting
Reported by: | Jon Dufresne | Owned by: | nobody |
---|---|---|---|
Component: | File uploads/storage | Version: | dev |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
There are a couple places in Django (file-based cache and FileSystemStorage
) that do a file-existence check before removing a file). This leads to an unnecessary race condition. It's easier to simply try to delete the file and pass silently if the file doesn't exist.
Note:
See TracTickets
for help on using tickets.
In 359be1c8: