Opened 19 years ago
Closed 16 years ago
#3200 closed defect (worksforme)
[patch] fix missing stack segments in debug.py views
| Reported by: | Owned by: | nobody | |
|---|---|---|---|
| Component: | Generic views | Version: | |
| Severity: | normal | Keywords: | debug |
| Cc: | Triage Stage: | Accepted | |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
The django/views/debug.py function technical_500_response misses stack elements which it cannot find source for. This is a common problem because django imports modules in a peculiar way so that all the filenames seem to miss the leading package. I have a patch which inserts default values when the source isn't found. This allows the full stack trace to be seen in the prettified view and some of the variables at least can be inspected. However, for obvious reasons context cannot be seen.
Attachments (2)
Change History (7)
by , 19 years ago
| Attachment: | views.py.patch added |
|---|
comment:1 by , 19 years ago
| Summary: | fix missing stack segments in debug.py views → [patch]fix missing stack segments in debug.py views |
|---|
comment:2 by , 19 years ago
| Keywords: | debug added |
|---|---|
| Summary: | [patch]fix missing stack segments in debug.py views → [patch] fix missing stack segments in debug.py views |
| Triage Stage: | Unreviewed → Ready for checkin |
comment:3 by , 19 years ago
I have a slightly improved patch. Under certain circumstances evaluating tb.tb_frame.f_locals.items() may cause an error; that creates even greater confusion. The solution is to safely evaluate that list.
comment:4 by , 19 years ago
| Triage Stage: | Ready for checkin → Accepted |
|---|
Before I check this in, I'd like to understand it a bit better. Could you provide a situation in which the stack elements are incomplete?
comment:5 by , 16 years ago
| Resolution: | → worksforme |
|---|---|
| Status: | new → closed |
I've never seen any issues with tracebacks and they're formatted nicely - maybe this was a problem with pre-1.0 django?
patch against 4207