Opened 9 years ago
Last modified 9 years ago
#26297 closed Bug
collectstatic --clear throws NotImplementedError, "This backend doesn't support absolute paths." — at Initial Version
Reported by: | Topher | Owned by: | nobody |
---|---|---|---|
Component: | contrib.staticfiles | Version: | 1.9 |
Severity: | Normal | Keywords: | clear notimplementederror path |
Cc: | berker.peksag@… | Triage Stage: | Ready for checkin |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
storage.py docstrings state of storage.path()
Storage systems that can't be accessed using open() should *not* implement this method.
collectstatic.py does not catch this to use the implemented storage.delete() method on line 221
Code highlighting:
full_path = self.storage.path(fpath) if not os.path.exists(full_path) and os.path.lexists(full_path): # Delete broken symlinks os.unlink(full_path) else: self.storage.delete(fpath)
Patch?:
Code highlighting:
try: full_path = self.storage.path(fpath) if not os.path.exists(full_path) and os.path.lexists(full_path): # Delete broken symlinks os.unlink(full_path) else: self.storage.delete(fpath) except NotImplementedError: self.storage.delete(fpath)
Note:
See TracTickets
for help on using tickets.