#6450 closed (fixed)
Incorrect directory creation in _save_FIELD_file
Reported by: | henry | Owned by: | nobody |
---|---|---|---|
Component: | Database layer (models, ORM) | Version: | dev |
Severity: | Keywords: | file directory creation fs-rf-fixed | |
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | yes | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
The function _save_FIELD_file incorrectly assumes that if makedirs throw an Exception it is because the directory already exists.
All kind of errors can trigger an exception (permission denied / no space left on device / hardware error ...). By silently ignoring the error, this function makes it harder to detect these problems.
The attached patch fixes these problems.
Attachments (2)
Change History (9)
by , 17 years ago
Attachment: | directory_creation.diff added |
---|
comment:1 by , 17 years ago
Triage Stage: | Unreviewed → Design decision needed |
---|
comment:2 by , 17 years ago
Keywords: | fs-rf added |
---|
comment:3 by , 17 years ago
Keywords: | fs-rf-fixed added; fs-rf removed |
---|
comment:4 by , 17 years ago
milestone: | → 1.0 beta |
---|
comment:5 by , 17 years ago
Needs tests: | set |
---|---|
Triage Stage: | Design decision needed → Accepted |
Yes, this is a change, but I can't see how anyone could be relying on the existing behaviour. Marking as accepted; patch needs tests.
by , 17 years ago
Attachment: | directory_creation_tests.diff added |
---|
comment:6 by , 16 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
Agreed, current code does seem to be a big presumption.
I'll pass through a design decision, since this is a potentially fundamental change. I can't see anything wrong with it though.