Opened 18 years ago

Closed 15 years ago

#3200 closed defect (worksforme)

[patch] fix missing stack segments in debug.py views

Reported by: robin@… 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)

views.py.patch (912 bytes ) - added by robin@… 18 years ago.
patch against 4207
debug.py.patch (908 bytes ) - added by robin@… 18 years ago.
improved patch against 4207

Download all attachments as: .zip

Change History (7)

by robin@…, 18 years ago

Attachment: views.py.patch added

patch against 4207

comment:1 by robin@…, 18 years ago

Summary: fix missing stack segments in debug.py views[patch]fix missing stack segments in debug.py views

comment:2 by Simon G. <dev@…>, 18 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: UnreviewedReady for checkin

comment:3 by robin@…, 18 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.

by robin@…, 18 years ago

Attachment: debug.py.patch added

improved patch against 4207

comment:4 by Adrian Holovaty, 18 years ago

Triage Stage: Ready for checkinAccepted

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 Adam Nelson, 15 years ago

Resolution: worksforme
Status: newclosed

I've never seen any issues with tracebacks and they're formatted nicely - maybe this was a problem with pre-1.0 django?

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