Opened 8 years ago

Closed 4 years ago

#3200 closed defect (worksforme)

[patch] fix missing stack segments in 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: UI/UX:


The django/views/ 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) (912 bytes) - added by robin@… 8 years ago.
patch against 4207 (908 bytes) - added by robin@… 7 years ago.
improved patch against 4207

Download all attachments as: .zip

Change History (7)

Changed 8 years ago by robin@…

patch against 4207

comment:1 Changed 8 years ago by robin@…

  • Summary changed from fix missing stack segments in views to [patch]fix missing stack segments in views

comment:2 Changed 7 years ago by Simon G. <dev@…>

  • Keywords debug added
  • Summary changed from [patch]fix missing stack segments in views to [patch] fix missing stack segments in views
  • Triage Stage changed from Unreviewed to Ready for checkin

comment:3 Changed 7 years ago by robin@…

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.

Changed 7 years ago by robin@…

improved patch against 4207

comment:4 Changed 7 years ago by adrian

  • Triage Stage changed from Ready for checkin to 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 Changed 4 years ago by adamnelson

  • Resolution set to worksforme
  • Status changed from new to closed

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

Add Comment

Modify Ticket

Change Properties
<Author field>
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.