HEX
Server: Apache
System: Linux sys.digiflyeg.com 4.18.0-553.62.1.lve.el8.x86_64 #1 SMP Mon Jul 21 17:50:35 UTC 2025 x86_64
User: opal (1023)
PHP: 8.1.33
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //lib64/python2.7/test/multibytecodec_support.pyc
�
zfc@s�ddlZddlZddlZddlZddlZddlmZddlmZddl	m	Z	dd
d��YZ
dejfd��YZd	�Z
dS(i����N(t
HTTPException(ttest_support(tStringIOtTestBasecBs�eZdZdZdZdZdZdZdZ	dZ
d�Zd�Zd�Z
d�Zd�Zd	�Zd
�Zd�Zd�Zd
�Zd�Zd�Zd�Zd�Zd�Zd�ZRS(tiiu�cCs�|jdkr'tj|j�|_n|jj|_|jj|_|jj|_|jj	|_
|jj|_|jj|_dS(N(
tcodectNonetcodecstlookuptencodingtencodetdecodetstreamreadertreadertstreamwritertwritertincrementalencodertincrementaldecoder(tself((s3/usr/lib64/python2.7/test/multibytecodec_support.pytsetUpscCs�x�tg|jD]}t|�j�^q�D]a\}}|j|�d}|j||jd��|jr/|j||j|�d�q/q/WdS(Nisutf-8(tzipttstringRt	readlinesRtassertEqualt
roundtriptestR
(Rtftnativetutf8tu((s3/usr/lib64/python2.7/test/multibytecodec_support.pyttest_chunkcoding#s	2	c
Csx|jD]
\}}}t|t�r4|j}n	|j}|r|||�d}||jkr�|jt|�tkt|��|j||d||j	|||f�q|jt|�tkt|��|j||d||j	|||f�q
|j
t|||�q
WdS(Nis%r.decode(%r, %r)=%r != %rs%r.encode(%r, %r)=%r != %r(t
codectestst
isinstancetbytesRR
t
assertTruettypetunicodeRR	tassertRaisestUnicodeError(Rtsourcetschemetexpectedtfunctresult((s3/usr/lib64/python2.7/test/multibytecodec_support.pyttest_errorhandle+s$	""cCsC|jr|jd�nd}|j|j|d�dd�dS(Ns$encoding contains full ISO 10646 mapuଓଣୠ nd eggstxmlcharrefreplaceisଓଣୠ nd eggs(thas_iso10646tskipTestRR
(Rts((s3/usr/lib64/python2.7/test/multibytecodec_support.pyttest_xmlcharrefreplaceBs	cs�|jr|jd�nddlm��fd�}tjd|�|jrc|j\}}nd}d}|j|j|d�d|�dS(	Ns$encoding contains full ISO 10646 mapi����(tcodepoint2namecs�t|t�s"td|��ng}xe|j|j|j!D]M}t|��kru|jd�t|��q?|jdt|��q?Wdj|�|jfS(Nsdon't know how to handle %ru&%s;u&#%d;u(	RtUnicodeEncodeErrort	TypeErrortobjecttstarttendtordtappendtjoin(texctltc(R1(s3/usr/lib64/python2.7/test/multibytecodec_support.pytxmlcharnamereplaceRsstest.xmlcharnamereplaceu«ℜ» = 〈ሴ〉s*«ℜ» = ⟨ሴ⟩i(	R-R.thtmlentitydefsR1Rtregister_errortxmlcharnametestRR
(RR=tsintsout((R1s3/usr/lib64/python2.7/test/multibytecodec_support.pyttest_customreplace_encodeLs		csn�fd�}tjd|�xHdddggdt�ddfD]"�|jt|j|jd�qDWdS(Ncs
�|jfS(N(R6(R:(tret(s3/usr/lib64/python2.7/test/multibytecodec_support.pyt	myreplacehsstest.cjktestiiitstringR(RR?RR4R$R3R
tunmappedunicode(RRE((RDs3/usr/lib64/python2.7/test/multibytecodec_support.pyttest_callback_wrong_objectsgs
+cCsyd�}tjd|�|j|jd|jdd�d�d�}tjd|�|jt|j|jd�dS(	NcSsdt|j�fS(Nux(tlongR6(R:((s3/usr/lib64/python2.7/test/multibytecodec_support.pyREqsstest.cjktestuabcduefght	abcdxefghi	cSsdtjdfS(Nuxi(tsystmaxint(R:((s3/usr/lib64/python2.7/test/multibytecodec_support.pyREws(RJi	(RR?RR
RGR$t
IndexError(RRE((s3/usr/lib64/python2.7/test/multibytecodec_support.pyttest_callback_long_indexps	
	cCs9d�}tjd|�|jt|j|jd�dS(NcSsdS(Nux(uxN(R(R:((s3/usr/lib64/python2.7/test/multibytecodec_support.pyRE~sstest.cjktest(RR?R$R3R
RG(RRE((s3/usr/lib64/python2.7/test/multibytecodec_support.pyttest_callback_None_index}s	csS�fd��d�_tjd��|j|jd|jdd�d�dS(	Ncs3�jdkr"�jd8_dSd|jfSdS(NiiuREPLACEDuTERMINAL(uREPLACEDi(tlimitR6(R:(RE(s3/usr/lib64/python2.7/test/multibytecodec_support.pyRE�sistest.cjktestuabcduefght4abcdREPLACEDabcdREPLACEDabcdREPLACEDabcdTERMINALefghi	(RQi	(RPRR?RR
RG(R((REs3/usr/lib64/python2.7/test/multibytecodec_support.pyttest_callback_backward_index�s	cCsDd�}tjd|�|j|jd|jdd�d�dS(NcSsd|jdfS(NuREPLACEDi(R6(R:((s3/usr/lib64/python2.7/test/multibytecodec_support.pyRE�sstest.cjktestuabcduefghtabcdREPLACEDghi	(RSi	(RR?RR
RG(RRE((s3/usr/lib64/python2.7/test/multibytecodec_support.pyttest_callback_forward_index�s	cCs9d�}tjd|�|jt|j|jd�dS(NcSsdS(NuTERMid(uTERMid((R:((s3/usr/lib64/python2.7/test/multibytecodec_support.pyRE�sstest.cjktest(RR?R$RMR
RG(RRE((s3/usr/lib64/python2.7/test/multibytecodec_support.pyttest_callback_index_outofbound�s	cCs�tjd�}x�dgtdd�dddddgD]�}|t|jd��}t�}|j�}xT|dk	r�|j|�}n|j�}|s�Pn|j|�}|j	|�qpW|j
|j�|jd	�q9WdS(
Nsutf-8ii!i@i�iiii(Rt	getreaderRtrangeRRRtreadR
twriteRtgetvalue(Rt
UTF8Readertsizehinttistreamtostreamtencodertdatate((s3/usr/lib64/python2.7/test/multibytecodec_support.pyttest_incrementalencoder�s	cCs�tjd�}x�ddgtdd�ddddd	gD]�}t|jd
�}|t��}|j�}x9|j|�}|s�Pqs|j|�}|j	|�qsW|j
|j�|jd�q<WdS(Nsutf-8i����ii!i@i�iiii(Rt	getwriterRRWRRRRXRRYRRZ(Rt
UTF8WriterR\R]R^tdecoderR`R((s3/usr/lib64/python2.7/test/multibytecodec_support.pyttest_incrementaldecoder�scCs�|j}|j�}|jt|j|t�d|_|j|j|t�d�|j�d�}t	j
d|�d|_|j|j|t�d�d|_|j|j|t�d�dS(NtignoreRcSs
d|jfS(Nucalled(R6(R:((s3/usr/lib64/python2.7/test/multibytecodec_support.pyttempreplace�sstest.incremental_error_callbacktcalled(RGRR$R2R
tTrueterrorsRtresetRR?(RtinvRaRh((s3/usr/lib64/python2.7/test/multibytecodec_support.pyt&test_incrementalencoder_error_callback�s		
			cCstjd�}x�dddgD]�}x�ddgtdd�dd	d
ddgD]�}|jt|jd
��}|t��}t||�}xC||�}|s�Pn|dkr�|j|�q�|j	|�q�W|j
|j�|jd�qRWqWdS(Nsutf-8RXtreadlineRi����ii!i@i�iiii(RRcRRWR
RRtgetattrt
writelinesRYRRZ(RRdtnameR\R]R^R)R`((s3/usr/lib64/python2.7/test/multibytecodec_support.pyttest_streamreader�sc	Csd
}tjd�}x�|D]�}x�dgtdd�ddd	d
dgD]�}|t|jd��}|jt��}t||�}x[|dk	r�||�}n	|�}|s�Pn|dkr�|j|�q�|j	|�q�W|j
|j�|jd�qLWqWdS(NRXRoRsutf-8ii!i@i�iiii(RXRoR(RRVRRWRRRRpRqRYRRZ(	Rt	readfuncsR[RrR\R]R^R)R`((s3/usr/lib64/python2.7/test/multibytecodec_support.pyttest_streamwriter�s$
	N(t__name__t
__module__R	RRRRRR-R@RGRRR+R0RCRHRNRORRRTRURbRfRnRsRu(((s3/usr/lib64/python2.7/test/multibytecodec_support.pyRs0	
			
				
		
						tTestBase_MappingcBsheZgZgZgZgZd�Zd�Zd�Zd�Z	d�Z
d�Zd�Zd�Z
RS(cOs\tjj|||�y|j�j�Wn+ttfk
rW|jd|j�nXdS(NsCould not retrieve (	tunittesttTestCaset__init__topen_mapping_filetclosetIOErrorRR.t
mapfileurl(Rtargstkw((s3/usr/lib64/python2.7/test/multibytecodec_support.pyR{	s
cCstj|j�S(N(Rtopen_urlresourceR(R((s3/usr/lib64/python2.7/test/multibytecodec_support.pyR|scCs-|jjd�r|j�n
|j�dS(Ns.xml(Rtendswitht_test_mapping_file_ucmt_test_mapping_file_plain(R((s3/usr/lib64/python2.7/test/multibytecodec_support.pyttest_mapping_files
cCs(d�}i}|j��}x�|D]�}|s5Pn|jd�dj�}t|�dkrfq%n|dd dkr�|jdj|��ntj|dd�}t|�dkr�d|dkr�q%n||d�}|d	ks%||krq%n|||<|j||�q%WWdQXdS(
NcSs djd�|jd�D��S(NRcss$|]}tt|d��VqdS(iN(tunichrtint(t.0tx((s3/usr/lib64/python2.7/test/multibytecodec_support.pys	<genexpr>st+(R9tsplit(R/((s3/usr/lib64/python2.7/test/multibytecodec_support.pytunichrsst#iit0xsInvalid line: {!r}ii�u�(R|R�tlentfailtformatR tfromhext
_testpoint(RR�turt_waRtlineR`tcsetchtunich((s3/usr/lib64/python2.7/test/multibytecodec_support.pyR�s&	
"
cCs�|j��}|j�}WdQXtjd|�}xX|D]P\}}tt|d��}djd�|j�D��}|j||�q:WdS(Ns'<a u="([A-F0-9]{4})" b="([0-9A-F ]+)"/>iRcss$|]}tt|d��VqdS(iN(tchrR�(R�R<((s3/usr/lib64/python2.7/test/multibytecodec_support.pys	<genexpr>9s(	R|RXtretfindallR�R�R9R�R�(RRtucmdatatuctunitcodedR�tcodech((s3/usr/lib64/python2.7/test/multibytecodec_support.pyR�3scCs%x|jD]}|j|�q
WdS(N(tsupmapsR�(Rtmapping((s3/usr/lib64/python2.7/test/multibytecodec_support.pyttest_mapping_supplemental<scCs�||f|jkrwy |j|j|j�|�Wqwtk
rs}|jdt|�t|�|jf�qwXn||f|jkr�y |j|j	|j�|�Wq�tk
r�}|jdt|�t|�|jf�q�XndS(Ns*Encoding failed while testing %s -> %s: %ss*Decoding failed while testing %s -> %s: %s(
tpass_enctestRR
R	R%R�treprtreasontpass_dectestR(RR�R�R:((s3/usr/lib64/python2.7/test/multibytecodec_support.pyR�@s 	' 	c
Cs3x,|jD]!\}}}t|t�r4|j}n	|j}|rt|t�r�||j|�}|jt|�tkt|��|j	||d||j|||f�q+||j|�}|jt|�tkt|��|j	||d||j|||f�q
|j
t||j|�q
WdS(Ns%r.decode(%r, %r)=%r != %rs%r.encode(%r, %r)=%r != %r(RRR RR
R	R!R"R#RR$R%(RR&R'R(R)R*((s3/usr/lib64/python2.7/test/multibytecodec_support.pyR+Ns&	""(RvRwR�R�R�RR{R|R�R�R�R�R�R+(((s3/usr/lib64/python2.7/test/multibytecodec_support.pyRxs								cCs�tjjtjjt�d�}ttjj||d�d��}|j�}WdQXttjj||d�d��}|j�}WdQX||fS(Ntcjkencodingss.txttrbs	-utf8.txt(tostpathR9tdirnamet__file__topenRX(RrtdirRtencodedR((s3/usr/lib64/python2.7/test/multibytecodec_support.pytload_teststringfs!%%((RR�R�RKRythttplibRttestRRRRzRxR�(((s3/usr/lib64/python2.7/test/multibytecodec_support.pyt<module>s�c