Opened 18 years ago

Closed 16 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)

filesystem.diff (2.1 KB ) - added by tbarta@… 17 years ago.
patch to generate a different exception type when a file is found but unreadable

Download all attachments as: .zip

Change History (4)

comment:1 by Chris Beaven, 17 years ago

Triage Stage: UnreviewedDesign decision needed
Version: 0.90

by tbarta@…, 17 years ago

Attachment: filesystem.diff added

patch to generate a different exception type when a file is found but unreadable

comment:2 by tbarta@…, 17 years ago

Cc: tbarta@… 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 Jacob, 16 years ago

Resolution: wontfix
Status: newclosed

I think adding the extra exception just makes the code more cluttered -- this is a pretty easy problem to figure out and diagnose.

Note: See TracTickets for help on using tickets.
Back to Top