Opened 19 years ago
Closed 17 years ago
#1194 closed enhancement (wontfix)
[patch] Check for file permissions for proper error messages
Reported by: | Tim | Owned by: | nobody |
---|---|---|---|
Component: | Core (Other) | Version: | |
Severity: | normal | Keywords: | |
Cc: | tbarta@… | Triage Stage: | Design decision needed |
Has patch: | yes | Needs documentation: | no |
Needs tests: | yes | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
I'm not sure how possible it is, but sometimes the error messages (eg TemplateDoesNotExist) don't reflect the correct problem. I've had a few times where it was simply a case of the apache user not being able to read the files, but the error message meant that I was looking at the problem from the wrong persective.
Would this be hard / worthwhile to implement? Maybe even at a basic level it could tell the user in the error message to check permissions?
Attachments (1)
Change History (4)
comment:1 by , 18 years ago
Triage Stage: | Unreviewed → Design decision needed |
---|---|
Version: | 0.90 |
by , 18 years ago
Attachment: | filesystem.diff added |
---|
comment:2 by , 18 years ago
Cc: | added |
---|---|
Has patch: | set |
Needs tests: | set |
Summary: | Check for file permissions for proper error messages → [patch] Check for file permissions for proper error messages |
I don't know much about the template loading system, but this patch should generate a different exception if a file is found in the template path, but could not be read due to access permissions. The exception raised is a subclass of TemplateDoesNotExist
, so try/except blocks elsewhere in the code should work. I am not sure about the errno
module's cross-compatibility... does anyone know if this will work with Windows or OS X?
comment:3 by , 17 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
I think adding the extra exception just makes the code more cluttered -- this is a pretty easy problem to figure out and diagnose.
patch to generate a different exception type when a file is found but unreadable