durusmail: quixote-users: cgitb patch
Misc feedback
2002-01-28
2002-01-28
2002-01-29
David Ascher (2 parts)
cgitb patch
2002-01-30
2002-01-30
2002-01-30
2002-01-30
2002-01-30
2002-01-30
2002-01-30
cgitb patch
Andrew Kuchling
2002-01-30
On Wed, Jan 30, 2002 at 06:13:24PM -0500, Greg Ward wrote:
>  * calling cgitb.enable() is a rather obscure and ass-backwards way
>    to tell Quixote you'd like cgitb-generated tracebacks.  Why
>    not use Quixote's existing configuation mechanism?  Idea:

Since both Greg and Neil suggested this, let's go with it.
format_internal_error() already looks at DISPLAY_EXCEPTIONS; maybe it
should just become:


 def format_internal_error (self, request, error_message):
      return error_message

And finish_failed_request would then contain:

       if not self.config.display_exceptions:
            # Use most-secure, internal error message
       elif self.config.display_exceptions == 'plain':
            # existing plain text version
       elif self.config.display_exceptions == 'html'
            # use cgitb

Part 3 of the patch would be changing the config.Config class to check
that display_exceptions is one of "plain", "html", or .

How does that approach sound?

--amk                                                  (www.amk.ca)
I can also withstand considerably more G-force than most people, even
though I do say so myself.
    -- The Doctor, in "The Ambassadors of Death"


reply