Skip to content

Commit c07b3a1

Browse files
masklinnberkerpeksag
authored andcommitted
bpo-29920: Document cgitb.text() and cgitb.html() functions (GH-849)
1 parent fdaeea6 commit c07b3a1

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

Doc/library/cgitb.rst

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,24 @@ analysis.
5454
value forces plain text output. The default value is ``"html"``.
5555

5656

57+
.. function:: text(info, context=5)
58+
59+
This function handles the exception described by *info* (a 3-tuple containing
60+
the result of :func:`sys.exc_info`), formatting its traceback as text and
61+
returning the result as a string. The optional argument *context* is the
62+
number of lines of context to display around the current line of source code
63+
in the traceback; this defaults to ``5``.
64+
65+
66+
.. function:: html(info, context=5)
67+
68+
This function handles the exception described by *info* (a 3-tuple containing
69+
the result of :func:`sys.exc_info`), formatting its traceback as HTML and
70+
returning the result as a string. The optional argument *context* is the
71+
number of lines of context to display around the current line of source code
72+
in the traceback; this defaults to ``5``.
73+
74+
5775
.. function:: handler(info=None)
5876

5977
This function handles an exception using the default settings (that is, show a

0 commit comments

Comments
 (0)