SF Patch 569574 - enhancements to cgitb for plain text display

This commit is contained in:
Skip Montanaro 2003-06-17 12:58:31 +00:00
parent d05abdec7b
commit 364ca40c2a
3 changed files with 108 additions and 18 deletions

View file

@ -12,9 +12,12 @@
\index{exceptions!in CGI scripts}
\index{tracebacks!in CGI scripts}
The \module{cgitb} module provides a special exception handler for CGI
scripts. After this module is activated, if an uncaught exception occurs,
a detailed, formatted report will be sent to the Web browser. The report
The \module{cgitb} module provides a special exception handler for Python
scripts. (It's name is a bit misleading. It was originally designed to
display extensive traceback information in HTML for CGI scripts. It was
later generalized to also display this information in plain text.) After
this module is activated, if an uncaught exception occurs, a detailed,
formatted report will be displayed. The report
includes a traceback showing excerpts of the source code for each level,
as well as the values of the arguments and local variables to currently
running functions, to help you debug the problem. Optionally, you can
@ -32,7 +35,7 @@ to a file for later analysis.
\begin{funcdesc}{enable}{\optional{display\optional{, logdir\optional{,
context}}}}
context\optional{, format}}}}}
This function causes the \module{cgitb} module to take over the
interpreter's default handling for exceptions by setting the
value of \code{\refmodule{sys}.excepthook}.
@ -46,6 +49,9 @@ to a file for later analysis.
The optional argument \var{context} is the number of lines of
context to display around the current line of source code in the
traceback; this defaults to \code{5}.
If the optional argument \var{format} is \code{"html"}, the output is
formatted as HTML. Any other value forces plain text output. The default
value is \code{"html"}.
\end{funcdesc}
\begin{funcdesc}{handler}{\optional{info}}