python (3.12.0)

(root)/
lib/
python3.12/
__pycache__/
cgitb.cpython-312.opt-1.pyc

ˑe0
dZddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlm
ZejeddZgZdZdZd	Zd
ZdZddZdd
ZGddZej4ZddZy)aMore comprehensive traceback formatting for Python scripts.

To enable this module, do:

    import cgitb; cgitb.enable()

at the top of your script.  The optional arguments to enable() are:

    display     - if true, tracebacks are displayed in the web browser
    logdir      - if set, tracebacks are written to files in this directory
    context     - number of lines of source code to show for each stack frame
    format      - 'text' or 'html' controls the output format

By default, tracebacks are displayed but not saved, the context is 5 lines
and the output format is 'html' (for backwards compatibility with the
original use of this module)

Alternatively, if you have caught an exception and want cgitb to display it
for you, call cgitb.handler().  The optional argument to handler() is a
3-item tuple (etype, evalue, etb) just like the value of sys.exc_info().
The default handler displays output as HTML.

N)escape)
)removecy)zAReturn a string that resets the CGI and browser to a known state.a'<!--: spam
Content-Type: text/html

<body bgcolor="#f0f0f8"><font color="#f0f0f8" size="-5"> -->
<body bgcolor="#f0f0f8"><font color="#f0f0f8" size="-5"> --> -->
</font> </font> </font> </script> </object> </blockquote> </pre>
</table> </table> </table> </table> </table> </font> </font> </font>r9/BuggyBox/python/3.12.0/bootstrap/lib/python3.12/cgitb.pyresetr(sHr	c|rd|zdzSy)Nz<small>z</small>rtexts r
smallr3s4*,,r	c|rd|zdzSy)Nz<strong>z	</strong>r
rrs r
strongr9sD ;..r	c|rd|zdzSy)Nz<font color="#909090">z</font>r
rrs r
greyr?s'$.::r	c||vrd||fS||jvrd|j|fSd|jvrL|jd}t|tr||vrd||fSdt
fSt||rdt	||fSdt
fS)z9Find the value for a given name in the given environment.localglobal__builtins__builtinN)	f_globals
isinstancedicthasattrgetattr	__UNDEF__)nameframelocalsbuiltinss    r
lookupr$Esv~t$$u...(??>2h%x (4.00?x& '(D"999?r	cgdddtf\}}}}}tj|D]\}}	}
}}|tjk(r|S|tjk(rm|	t
jvr[|dk(r1|turct||	t}|j||	z||fn:t|	||\}
}|j|	|
|fn|	dk(r||dzz
}|}nd\}}|	}|S)zEScan one logical line of Python and look up values of variables used.Nr
.)Nr
)
rtokenizegenerate_tokensNEWLINENAMEkeywordkwlistrappendr$)readerr!r"vars	lasttokenparentprefixvaluettypetokenstartendlinewheres              r
scanvarsr:Us-/tR-J*D)VVU*2*B*B6*J&ueS$H$$$eKHMM!e7>>&AC*#FE9=EKK% ?@%eUF;uUE512
c\i#o%FF%NFF	 Kr	cZ	"#|\}}}t|tr|j}dtjjdzdztjz}tjtj}dtt|d|d|d}dtd	zd
z}g}	tj||}
|
D]\}"}}
}}"rFtjj!""d"dt"j$j'"d
}ndx"}tj(|\}}}}d}|
dk7rNdt+t"j$j'|
z}|
dk7r|tj,||||dz
}i#|gf"#fd	}t/|||}dd|d|dg}|||z
}|D]}tddt1t|z
zt|zdz}|#vr:d|t"j$j3|d}|j5d|znBd|t"j$j3|d}|j5d t7|z|d!z
}ig}}|D]\}}} ||vrd!||<| t8ur{|d"vrd#|zt+|z}n1|d$k(rt+|}n |t+|jd%d&z}|j5|d't"j$j;| |j5|d(z|j5d tt7d)j=|z|	j5d*d+j=|zd,t+t"j$j't|dt"j$j't|g}!t?|D]M}|dd!d-k(rt"j$j;tA||} |!j5d.||d/| O|dj=|	zdj=|!zd0t"j$j'dj=tCjD|||zzS)1z9Return a nice HTML document describing a given traceback.Python r: z
<body bgcolor="#f0f0f8">
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
<tr bgcolor="#6622aa">
<td valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial">&nbsp;<br>
<big><big><strong>zo</strong></big></big></font></td>
<td align=right valign=bottom>
<font color="#ffffff" face="helvetica, arial">z<br>z</font></td>
</tr></table>
<p>A problem occurred in a Python script.  Here is the sequence of
function calls leading up to the error, in the order they occurred.</p>z<tt>z&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;z&nbsp;</tt>z<a href="file://z">z</a>?r
in <module>cFdtjj|zSN=)pydochtmlreprr3s r
<lambda>zhtml.<locals>.<lambda>cEJJOOE4J.Jr	formatvaluecd|d<tj|d|dxxdz
cc<S#|dxxdz
cc<wxYwNr	linecachegetlinelnumfile	highlights r
r.zhtml.<locals>.reader@!"Id1g!))$Q8!W\WT!W\W0?z<tr><td bgcolor="#d8bbff">z<big>&nbsp;</big> z
</td></tr>Nz&nbsp;z	<tt>=&gt;z</tt>z&<tr><td bgcolor="#ffccee">%s</td></tr>z<tt>&nbsp;&nbsp;z<tr><td>%s</td></tr>rN)rrz<em>%s</em> rr&z&nbsp;= z <em>undefined</em>z, zF
<table width="100%%" cellspacing=0 cellpadding=0 border=0>
%s</table>
z<p>_z
<br>z&nbsp;=
z


<!-- The above is a description of an error in a Python program, formatted
     for a web browser because the 'cgitb' module was enabled.  In case you
     are not reading this in a web browser, here is the original traceback:

%s
-->
)#rtype__name__sysversionsplit
executabletimectimehtml_escapestrrinspectgetinnerframesospathabspathrDrErgetargvaluesrformatargvaluesr:len	preformatr-rrrFjoindirr	tracebackformat_exception)$einfocontextetypeevalueetbpyverdateheadindentframesrecordsr!rSfunclinesindexlinkargsvarargsvarkwr"callr.r/rowsir8numdonedumpr r9r3	exceptionrTrUs$                                  @@r
rErEjskE63%))+A..5FE::diik"Ds5z*+,//4gT$@HKDeL)
)M
9F
F$$S'2G185!-tT477??4(D379J9J49PQDD4'.';';E'B$guf3;6%**"3"3D"9::Dz!//guf JLL		"v.%dD23uA
H#c!f+
6Q?@8K	>36

8L8LT8RSDKK H4 OP";>uzz?S?STX?YZDKK 6d CDQ
d"&	:D%t|XDJI%11*U2fTlBDg%!$<D 6$**S/"*=#>>DdEJJOOE4JKLD#889	:	
*U4		$3H-IIJ

		$ 	!g5!n!'uzz'8'8U'D E %

 1 1#f+ >@AIFJ8s?H

 56FD%HIJ
"''&/!BGGI$66	:jj
''),,UFC@
AC
:C
C
Cr	c	: !|\}}}t|tr|j}dtjjdzdztjz}tjtj}t|d|d|ddz}g}tj||}	|	D]\}
 }}}
} xrtjj xsd tj|
\}}}}d}|dk7r(d|z}|d	k7r|tj ||||d
z
}i!|gf !fd	}t#||
|}d
 d
|g}|8||z
}|
D].}d|z}|j%||j'z|dz
}0ig}}|D]\}}}||vrd||<|t(ur[|dk(rd|z}n|dk7r||jddz}|j%|dt*j,j/|t|j%|dz|j%dj1||j%ddj1|zt|dt|g}t3|D]D}t*j,j/t5||}|j%dd|d|F|dj1|zdj1|zddj1t7j8|||zzS)z:Return a plain text document describing a given traceback.r<rr=r[z
A problem occurred in a Python script.  Here is the sequence of
function calls leading up to the error, in the order they occurred.
r>r
r?r@cFdtjj|zSrB)rDrrFrGs r
rHztext.<locals>.<lambda>rIr	rJcd|d<tj|d|dxxdz
cc<S#|dxxdz
cc<wxYwrMrOrRs r
r.ztext.<locals>.readerrVrWrXz%5d rNrzglobal rr&rZz = z
 undefinedz
%s
z    zc

The above is a description of an error in a Python program.  Here is
the original traceback:

%s
)rr]r^r_r`rarbrcrdrfrgrhrirjrkrlrmr:r-rstriprrDrrFrprqrrrrs)"rtrurvrwrxryrzr{r}r~r!rSrrrrrrr"rr.r/rrr8rrrr r9r3rrTrUs"                                @@r
rrs
E63%))+A..5FE::diik"D Z59D
F$$S'2G18%2-tT4--4'.';';E'B$guf3;4<Dz!//guf JLL		"v. $'(uA
qjC
-.Q

d"&	1D%t|XDJI%H$Y-=dg%edjjob6I.Ituzzu/EFGD</0	1	
DIIdO$

h401K%2N!ZV56IF?

 56%u=>?"''&/!BGGI$66:	ggi((<=
:>>>r	c*eZdZdZ		ddZdZddZy)Hookz?A hook to replace sys.excepthook that shows tracebacks in HTML.Ncn||_||_||_|xstj|_||_yN)displaylogdirrur_stdoutrTformat)selfrrrurTrs      r
__init__z
Hook.__init__s.&CJJ	r	c,|j|||fyr)handle)rrvrwrxs    r
__call__z
Hook.__call__sUFC()r	cj|xstj}|jdk(r#|jj	t|jdk(xrtxst}d}	|||j}|jrb|rAtjj|}|jj	d|zdzn:|jj	|dzn|jj	d|jd	d
g|jdk(}t!j"||j\}}	t%j&|d5}|j	|dddd
|z}	|jdk(r|jj	d|	zn|jj	|	dz	|jj)y#djtj|}d}YxYw#1swYxYw#d|z}	YxYw#YyxYw)NrEFr
Tz<pre>z</pre>
r[z*<p>A problem occurred in a Python script.
z.txtz.html)suffixrqwz*%s contains the description of this error.z*Tried to save traceback to %s, but failed.z
<p>%s</p>
)r_exc_inforrTwriterrErrurprrrsrrDrrtempfilemkstemprifdopenflush)
rinfo	formatterplaindocrfdrjrTmsgs
          r
rzHook.handles%s||~;;& IIOOEG$[[&(2d:d		D$,,/C
<<jj'',		#
 :;		d
+IIOOIJ;;"g&t{{F':;F!))T[[IJR
JYYr3'$4JJsO$BTI{{f$		
 34		d
+	IIOO;	'')44d;<CE $$
JBTI	s<-G+H"$H6
H"H.+%HHH""H+.H2)rNNrYNrEr)r^
__module____qualname____doc__rrrrr	r
rr
sI?C*'r	rc4t||||t_y)aInstall an exception handler that formats tracebacks as HTML.

    The optional argument 'display' can be set to 0 to suppress sending the
    traceback to the browser, and 'logdir' can be set to a directory to cause
    tracebacks to be written to files there.rrrurN)rr_
excepthookrs    r
enablerEs'&")&:CNr	)rY)rNNrYrE)rrgr+rPrirDr_rrcr'rrwarningsrErre_deprecatedr^rrrrrr$r:rrrhandlerrrr	r
<module>rs.	
&Xg.H
	 *_CB@>D55n&--:r