Opened 18 years ago
Closed 13 years ago
#6412 closed New feature (fixed)
[patch] Check for file permissions for proper error messages
| Reported by: | Owned by: | Markus Holtermann | |
|---|---|---|---|
| Component: | Core (Other) | Version: | dev |
| Severity: | Normal | Keywords: | |
| Cc: | Markus Holtermann | Triage Stage: | Ready for checkin |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | yes | UI/UX: | no |
Description
This is a duplicate to #1194 with a simpler fix that only affects debug.py.
This problem bit me earlier today (in my first django installation) and while it wasn't *that* hard to figure out it would've saved me a good 20 minutes of poking around. Think of the newbies!
Also, FWIW the non-readability of templates was caused by a too-restrictive umask (0027) on my part; apparently data file installation from setup.py copies without modifying permissions, so I was stuck.
Attachments (1)
Change History (22)
by , 18 years ago
comment:1 by , 18 years ago
| Triage Stage: | Unreviewed → Design decision needed |
|---|
Interesting idea. Seems like a good one, but I'll pass via design decision.
comment:2 by , 18 years ago
I spent half an hour debugging this exact problem a while ago - having the debug view highlight it is an excellent idea.
comment:3 by , 15 years ago
| Type: | → New feature |
|---|
comment:4 by , 15 years ago
| Severity: | → Normal |
|---|
comment:5 by , 14 years ago
| Easy pickings: | unset |
|---|---|
| Triage Stage: | Design decision needed → Accepted |
| UI/UX: | unset |
This seems like a useful feature that can be added in just a few lines of code.
comment:6 by , 13 years ago
| Easy pickings: | set |
|---|
Updated patch: https://github.com/django/django/pull/443
comment:7 by , 13 years ago
| Needs tests: | set |
|---|
Looks good, but I still think that this should be tested.
comment:8 by , 13 years ago
| Owner: | changed from to |
|---|
Eh, I have a hard time testing this on Windows (can't set a file unreadable). Will update the patch next week.
comment:9 by , 13 years ago
| Owner: | changed from to |
|---|---|
| Status: | new → assigned |
Have merged with master and running tests right now: https://travis-ci.org/dokterbob/django/builds/5020749
https://github.com/dokterbob/django/tree/ticket6412
Note: Yes, Travis support will be rebased out in the definitive patch.
comment:10 by , 13 years ago
Tests are failing on Python 3.x due to errors with StringIO. Attempting to fix now.
comment:11 by , 13 years ago
Waiting for https://travis-ci.org/dokterbob/django/builds/5021135
Todo: shorten commit line.
comment:12 by , 13 years ago
| Triage Stage: | Accepted → Ready for checkin |
|---|
Build passed: https://travis-ci.org/dokterbob/django/builds/5021135
Fixed import issue in Python 3.x related to StringIO import in the process.
comment:14 by , 13 years ago
| Needs tests: | unset |
|---|
I tested the linked pull request (https://github.com/django/django/pull/838) on Python 2.7.3 and Python 3.3.0 with Linux. The tests pass for both versions.
comment:15 by , 13 years ago
| Patch needs improvement: | set |
|---|
The patch looks almost good, although using a NamedTemporaryFile would be better.
comment:16 by , 13 years ago
| Owner: | changed from to |
|---|
comment:17 by , 13 years ago
I updated the patch to use the NamedTemporaryFile for the former two tests. The latter works on a directory, hence there is no way to automatically remove that directory.
comment:18 by , 13 years ago
| Cc: | added |
|---|---|
| Patch needs improvement: | unset |
comment:19 by , 13 years ago
I updated the pull request to fix some PEP-8 issues. https://github.com/django/django/pull/947
comment:20 by , 13 years ago
| Triage Stage: | Accepted → Ready for checkin |
|---|
Patch looks good. I would prefer it if the messages were not defined in the view. But since this is the debug view the template is included in the same file anyway so this is no big deal.
comment:21 by , 13 years ago
| Resolution: | → fixed |
|---|---|
| Status: | assigned → closed |
simple debug.py patch to report non-readability of template files