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
Greg Ward
2002-01-30
On 30 January 2002, Andrew Kuchling said:
> If display_exceptions is true, this always sets the content-type to
> text/plain.  I submit that this is bogus; the caller is providing the
> content of the message, and should therefore set the content-type to
> text or HTML or whatever it sees fit.

D'ohh!  You're right there.

I have two problems with this patch:

  * cgitb was added in Python 2.2, so we need to be a bit careful
    when importing it

  * 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:
    redefine DISPLAY_EXCEPTIONS, and give it the following values:
      None - don't display exceptions at all (most secure, therefore
             default)
      "text" - display plain text exceptions
      "cgitb" - display fancy cgitb-generated exceptions

    For backwards compatibility, any false value should be interpreted
    the same as None, and any true value apart from "cgitb" should be
    interpreted as "text".

    We might also consider using "fancy" or "html" or something
    instead of "cgitb".  We'd still use the cgitb module, we
    just wouldn't admit it.  ;-)

    Thoughts?

        Greg
--
Greg Ward - software developer                gward@mems-exchange.org
MEMS Exchange                            http://www.mems-exchange.org


reply