﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
20534	Make TECHNICAL_500 more resilient (against large variables and non-utf-8)	Walter Doekes	nobody	"Hi,

I recently had errors that didn't provide a nice TECHNICAL_500_TEMPLATE mail.

The cause turned out to be two things:
(1) large variables caused a mail so large that the MXs refused to deliver them
(2) non-utf8 representations of objects caused errors while handling the error

The attached fix fixed it.

This was done against Django 1.4. Apologies in advance if this is fixed somewhere already. I couldn't find a relevant bug report.

Triggering (1) should be a matter of generating an error up the stack with a huge variable. Triggering (2) can be done like this:
{{{
urlpatterns = (
    # Error test
    (r'500$', (lambda r: Crap())),  # ExplodeInYourFaceError
)

class Crap(Exception):
    def __init__(self):
        raise self
    def __repr__(self):
        return 'X\xe9X'
}}}

Regards,[[br]]
Walter Doekes[[br]]
OSSO B.V."	Bug	closed	Core (Other)	1.4	Normal	duplicate		Walter Doekes	Accepted	1	0	0	0	0	0
