403Webshell
Server IP : 118.27.122.248  /  Your IP : 216.73.216.15
Web Server : Apache
System : Linux web0264.sh.tyo1 4.18.0-553.79.1.lve.el7h.x86_64 #1 SMP Wed Oct 15 16:34:46 UTC 2025 x86_64
User : c9415830 ( 11735)
PHP Version : 8.4.17
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /opt/alt/python36/lib64/python3.6/test/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /opt/alt/python36/lib64/python3.6/test/__pycache__/test_marshal.cpython-36.pyc
3

�w2_�M�@s�ddlmZddlZddlZddlZddlZddlZddlZddlZyddl	Z	Wne
k
rhdZ	YnXGdd�d�ZGdd�deje�Z
Gdd�deje�ZGd	d
�d
eje�ZGdd�dej�ZGd
d�dej�ZGdd�deje�ZGdd�deje�ZGdd�dej�Zd+Zejdk�r&dndZGdd�d�Zejeejkd�Gdd�dej��Zdd �ZGd!d"�d"eje�ZGd#d$�d$ej�ZGd%d&�d&eje�Zejej e	d'�Gd(d)�d)eje���Z!e"d*k�r�ej#�dS),�)�supportNc@seZdZdd�ZdS)�HelperMixincGs�tjtj|f|���}|j||�z\ttjd��}tj||f|��WdQRXttjd��}tj|�}WdQRX|j||�Wdtj	tj�XdS)N�wb�rb)
�marshal�loads�dumps�assertEqual�openr�TESTFN�dump�load�unlink)�self�sampleZextra�new�f�r�6/opt/alt/python36/lib64/python3.6/test/test_marshal.py�helperszHelperMixin.helperN)�__name__�
__module__�__qualname__rrrrrrsrc@s$eZdZdd�Zdd�Zdd�ZdS)�IntTestCasecCs>tjd}x.|r8x||fD]}|j|�qW|d?}qWdS)N��)�sys�maxsizer)r�n�expectedrrr�	test_intss

zIntTestCase.test_intscCs�d}|d}xh||||d?fD]P}xJ|rrdtj|dddd�}tj|�}|j||�|dkrhd}q*|dL}q*Wq$Wtjd	�}|j|d
�tjd�}|j|d�tjd
�}|j|d�tjd�}|j|d�dS)Nr�?�I��littleT)Zsignedrs	I�ܺ�vT2l�\u1�Q�s	I#Eg����l�\u1�Q�s	I*;L]nlTv0ur{s	I���ij���l	Tv0ur{ll�������l�����\u1�Q�l����	Tv0ur{)�int�to_bytesrrr	)rZmaxint64Zminint64�base�s�gotrrr�
test_int64%s$





zIntTestCase.test_int64cCsxdD]}|j|�qWdS)NTF)TF)r)r�brrr�	test_bool<s
zIntTestCase.test_boolN)rrrr r+r-rrrrrsrc@seZdZdd�ZdS)�
FloatTestCasecCs�d}tjd}x6||krDx ||fD]}|jt|��q$W|d}qWd}tj|d�}tj|�}|j||�tj|d�}tj|�}|j||�tjd}xF||kr�x0||fD]"}t|�}|j|�|j|d�q�W|d9}q�WdS)Ng�}���:g�6�ҫ�sgS��:�^@grrg��Z1%)rrr�floatrrrr	)rZsmallrrrr)r*rrr�test_floatsAs(






zFloatTestCase.test_floatsN)rrrr0rrrrr.@sr.c@s$eZdZdd�Zdd�Zdd�ZdS)�StringTestCasecCs4x.dddddgD]}|jtjtj|���qWdS)N�u
Andrè Previn�abc� i')rrrr)rr)rrr�test_unicode\szStringTestCase.test_unicodecCs(x"dddddgD]}|j|�qWdS)Nr2u
Andrè Previnr3r4i')r)rr)rrr�test_string`szStringTestCase.test_stringcCs(x"dddddgD]}|j|�qWdS)N�sAndr� Previnsabc� i')r)rr)rrr�
test_bytesdszStringTestCase.test_bytesN)rrrr5r6r9rrrrr1[sr1c@seZdZdd�ZdS)�ExceptionTestCasecCs tjtjt��}|jt|�dS)N)rrr�
StopIterationr	)rrrrr�test_exceptionsisz!ExceptionTestCase.test_exceptionsN)rrrr<rrrrr:hsr:c@s2eZdZdd�Zdd�Zdd�Zejdd��Zd	S)
�CodeTestCasecCs(tjj}tjtj|��}|j||�dS)N)r:r<�__code__rrrr	)r�corrrr�	test_codenszCodeTestCase.test_codecCs&d}tjjf|}tjtj|��dS)Ni�)r:r<r>rrr)r�countZcodesrrr�test_many_codeobjectsssz"CodeTestCase.test_many_codeobjectscCsPtddd�}tddd�}tjtj||f��\}}|j|jd�|j|jd�dS)N�x�f1�exec�y�f2)�compilerrrr	�co_filename)rZco1Zco2rrr�test_different_filenamesys
z%CodeTestCase.test_different_filenamescCsPd}t|dd�}tjtj|��}x*|jD] }t|tj�r(|j|j	|j	�q(WdS)Nzdef f(): pass
def g(): passZmyfilerE)
rHrrr�	co_consts�
isinstance�types�CodeType�assertIsrI)rr)r?�objrrr�test_same_filename_used�sz$CodeTestCase.test_same_filename_usedN)	rrrr@rBrJr�cpython_onlyrQrrrrr=msr=c	@sReZdZdddddgdddd	�Zd
d�Zdd
�Zdd�Zdd�Zej	dd��Z
dS)�ContainerTestCasezfoo@bar.baz.spamgH�zns�@r��.zyx.41�
Fu
Andrè Previn)ZastringZafloatZanintZ
ashortlongZalistZatupleZabooleanZaunicodecCs|j|j�dS)N)r�d)rrrr�	test_dict�szContainerTestCase.test_dictcCs|jt|jj���dS)N)r�listrW�items)rrrr�	test_list�szContainerTestCase.test_listcCs|jt|jj���dS)N)r�tuplerW�keys)rrrr�
test_tuple�szContainerTestCase.test_tuplecCs*x$ttfD]}|j||jj���q
WdS)N)�set�	frozensetrrWr])r�constructorrrr�	test_sets�szContainerTestCase.test_setscCs&t�}tjtj|��}|j||�dS)N)r`rrrrO)rrPZobj2rrr�test_empty_frozenset_singleton�sz0ContainerTestCase.test_empty_frozenset_singletonNi)rU)
rUrUrUrUrUrUrUrUrUrU)rrrrWrXr[r^rbrrRrcrrrrrS�srSc@s$eZdZdd�Zdd�Zdd�ZdS)�BufferTestCasecCs6td�}|j|�tjtj|��}|jt|�t�dS)Nsabc)�	bytearrayrrrrr	�type�bytes)rr,rrrr�test_bytearray�s
zBufferTestCase.test_bytearraycCs6td�}|j|�tjtj|��}|jt|�t�dS)Nsabc)�
memoryviewrrrrr	rfrg)rr,rrrr�test_memoryview�s
zBufferTestCase.test_memoryviewcCs,tjdd�}tjtj|��}|j|d�dS)N�Bsabc)�arrayrrrr	)r�arrrr�
test_array�szBufferTestCase.test_arrayN)rrrrhrjrnrrrrrd�srdc@steZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�ZdS)�BugsTestCasecCstjdgd�dS)N�i�)rr)rrrr�test_bug_5888452�szBugsTestCase.test_bug_5888452cCsF|jttjd�|jttjd�|jttjtjdd�dd��dS)N�0�fr�Arr%)�assertRaises�	Exceptionrrr)rrrr�test_patch_873224�szBugsTestCase.test_patch_873224cCs8|jtjtjdd��d�|jtjtjdd��d�dS)N�rr)r	rrr)rrrr�test_version_argument�sz"BugsTestCase.test_version_argumentcCsDx>td�D]2}t|g�}ytj|�Wq
tk
r:Yq
Xq
WdS)N�)�rangergrrrv)r�i�crrr�	test_fuzz�s
zBugsTestCase.test_fuzzcs.dd�}|dtj��fdd�}|d|�dS)	NcSs\|d|d�|d|d�|d|d�|d|dd|�|d|d�dS)Ns)�Ns(s[s{Nrrs>r)�N�checkrrr�	run_tests�s
z4BugsTestCase.test_loads_recursion.<locals>.run_tests�dcs�jttj|�dS)N)ru�
ValueErrorrr)r))rrrr��sz0BugsTestCase.test_loads_recursion.<locals>.checkrrTi)rr)rr�r�r)rr�test_loads_recursion�sz!BugsTestCase.test_loads_recursioncCs�g}}tjdkr"ttd�r"d}nd}x(t|d�D]}|jdg�|d}q4Wtj|�}tj|�}|j	t
|�t
|��|j	t
|d�t
|d��|j	t
|d	�t
|d
��|jdg�|jttj|�dS)N�nt�gettotalrefcounti�i�rrrr%r%r%)
�os�name�hasattrrr{�appendrrrr	�lenrur�)r�headZlastZMAX_MARSHAL_STACK_DEPTHr|�dataZnew_headrrr�test_recursion_limit�s

z!BugsTestCase.test_recursion_limitcCsBx<ttttttttfD]$}td|fi�}|j	t
tj|��qWdS)N�subtyp)
r&r/�complexr\rY�dictr_r`rfrur�rr)r�typr�rrr�test_exact_type_matchsz"BugsTestCase.test_exact_type_matchcCstd�}d|}tj|�dS)Ng��.Ar3)r&rr)r�sizeZ
testStringrrr�test_large_marshal
szBugsTestCase.test_large_marshalcCsd}|jttj|�dS)Ns	l)rur�rr)rZinvalid_stringrrr�test_invalid_longsszBugsTestCase.test_invalid_longscCs�ddddddddgff}x�d
D]�}t|�}g}z�ttjd��<}x4|D],}tj||�|rb|j|�|j|j��qDWWdQRXttjd��P}xHt	|�D]<\}}|j
|tj|��|r�|j|�|j
|||j��q�WWdQRXWdtj
tj�XqWdS)Nrr3sdefg�?rrmr,�cr7�0123rr)r7r�)r�r
rrrr�writer��tell�	enumerater	r
�readr)rr�ZinterleavedZilenZ	positionsrrWr|rrr�test_multiple_dumps_and_loadss$



&z*BugsTestCase.test_multiple_dumps_and_loadscCsd}|jttj|�dS)N�T)ru�	TypeErrorrr)rZunicode_stringrrr�!test_loads_reject_unicode_strings/sz.BugsTestCase.test_loads_reject_unicode_stringscCs>Gdd�dtj�}x&dD]}|jttj|tj|���qWdS)NcseZdZ�fdd�Z�ZS)z/BugsTestCase.test_bad_reader.<locals>.BadReadercs(t�j|�}|dk	r$|dkr$|d7}|S)N�rV�i@B)�super�readinto)rZbufr)�	__class__rrr�6sz8BugsTestCase.test_bad_reader.<locals>.BadReader.readinto)rrrr��
__classcell__rr)r�r�	BadReader5sr���?��?�
0123456789�
0123456789)r�r�r�r�)�io�BytesIOrur�rr
r)rr��valuerrr�test_bad_reader4s

zBugsTestCase.test_bad_readercCs<tjd�}x,tt|��D]}|jttj|d|��qWdS)N�hello�dollyr)r�r�N)rrr{r�ru�EOFErrorr)rr�r|rrr�test_eof?s
zBugsTestCase.test_eofN)rrrrqrwryr~r�r�r�r�r�r�r�r�r�rrrrro�s

ror�l��r#r�c@seZdZdd�ZdS)�
NullWritercCsdS)Nr)rr)rrrr�HszNullWriter.writeN)rrrr�rrrrr�Gsr�z!test cannot run on 32-bit systemsc@s�eZdZdd�Zejeddd�dd��Zejeddd�dd	��Zejee	d
dd�dd��Z
ejee	d
dd�d
d��Zejee	dej
ed
�dd�dd��Zejee	dej
ed
�dd�dd��Zejeddd�dd��ZdS)�LargeValuesTestCasecCs|jttj|t��dS)N)rur�rrr�)rr�rrr�check_unmarshallableMsz(LargeValuesTestCase.check_unmarshallablerF)r�ZmemuseZdry_runcCs|jd|�dS)N�x)r�)rr�rrrr9PszLargeValuesTestCase.test_bytescCs|jd|�dS)NrC)r�)rr�rrr�test_strTszLargeValuesTestCase.test_strrcCs|jd|�dS)N)N)r�)rr�rrrr^XszLargeValuesTestCase.test_tuplecCs|jdg|�dS)N)r�)rr�rrrr[\szLargeValuesTestCase.test_list�cCs|jtt|���dS)N)r�r_r{)rr�rrr�test_set`szLargeValuesTestCase.test_setcCs|jtt|���dS)N)r�r`r{)rr�rrr�test_frozensetfsz"LargeValuesTestCase.test_frozensetcCs|jt|��dS)N)r�re)rr�rrrrhlsz"LargeValuesTestCase.test_bytearrayN)rrrr�rZ
bigmemtest�
LARGE_SIZEr9r��pointer_sizer^r[r�	getsizeofr�r�rhrrrrr�Ksr�cCs�t|�|krdS|jt|��t|ttttf�rJxL|D]}t||�q6Wn4t|t�r~x(|j	�D]\}}t||�t||�q^Wt
|�S)z&Collect object ids seen in a structureN)�id�addrLrYr\r_r`�CollectObjectIDsr�rZr�)ZidsrP�e�k�vrrrr�ps


r�c@sbeZdZdZdZdZdedeediZddd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dS)�InstancingTestCasei��g��n���?Zabcde�r�ZgoodbyeFc
Cs�||f}tt�|�}tj|d�}tt�tj|��}|j||�|s�tj|d�}tt�tj|��}	|j|	|�|s�|jt|�t|��n|jt|�t|��dS)Nr�r)	r�r_rrrr	Z
assertGreaterr�ZassertGreaterEqual)
rZrsample�	recursive�simplerZn0Zs3Zn3�s2Zn2rrr�helper3�szInstancingTestCase.helper3cCs |j|j�|j|jdd�dS)NT)r�)r�intobjr�)rrrr�testInt�szInstancingTestCase.testIntcCs|j|j�|j|j�dS)N)r�floatobjr�)rrrr�	testFloat�szInstancingTestCase.testFloatcCs|j|j�|j|j�dS)N)r�strobjr�)rrrr�testStr�szInstancingTestCase.testStrcCs|j|j�|j|j�dS)N)r�dictobjr�)rrrr�testDict�szInstancingTestCase.testDictcCsLttd��}|j�}WdQRXtjd�r4t|td�}|j|�|j|�dS)Nrz.pyrE)r
�__file__r��endswithrHrr�)rr�coderrr�
testModule�s

zInstancingTestCase.testModulecCsDt|j�}||d<|j|dd�|jg}|j|�|j|dd�dS)NrT)r�)r�r�r�r�)rrW�lrrr�
testRecursion�s

z InstancingTestCase.testRecursionNZabcdeabcdeabcde)FF)rrrr�r�r�r�r�r�r�r�r�r�r�rrrrr�~s
r�c@s4eZdZdd�Zdd�Zdd�Zdd�Zd	d
�ZdS)�CompatibilityTestCasecCsNttd��}|j�}WdQRXtjd�r4t|td�}tj||�}tj|�dS)Nrz.pyrE)r
r�r�r�rHrrr)r�versionrr�r�rrr�_test�s
zCompatibilityTestCase._testcCs|jd�dS)Nr)r�)rrrr�test0To3�szCompatibilityTestCase.test0To3cCs|jd�dS)Nr)r�)rrrr�test1To3�szCompatibilityTestCase.test1To3cCs|jd�dS)Nr)r�)rrrr�test2To3�szCompatibilityTestCase.test2To3cCs|jd�dS)Nr�)r�)rrrr�test3To3�szCompatibilityTestCase.test3To3N)rrrr�r�r�r�r�rrrrr��s
r�c@s*eZdZdZeje�Zdd�Zdd�ZdS)�InterningTestCasezthis is an interned stringcCsXtjtj|j��}|j||j�|jt|�t|j��tj|�}|jt|�t|��dS)N)rrrr�r	r�r�intern)rr)r�rrr�
testIntern�s

zInterningTestCase.testInterncCsZtjtj|jd��}|j||j�|jt|�t|j��tj|�}|jt|�t|��dS)Nr)	rrrr�r	ZassertNotEqualr�rr�)rr)r�rrr�testNoIntern�s

zInterningTestCase.testNoInternN)rrrr�rr�r�r�rrrrr��s
r�zrequires _testcapic@s<eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
S)�
CAPI_TestCasecCsdx^ttjd�D]L}tjdtj|�ttjd��}|j�}WdQRXtj	tj�|j
|d�qWdS)NrixV4rsxV4)r{rr��	_testcapiZpymarshal_write_long_to_filerrr
r�rr	)rr�rr�rrr�test_write_long_to_file�sz%CAPI_TestCase.test_write_long_to_filecCs~dddddddf}xdttjd	�D]R}tj|tj|�ttjd
��}|j�}WdQRXtj	tj�|j
tj|�|�q$WdS)Nu€sabc�{g������F@�y @z
long line i�rry@ @)r{rr�r�Zpymarshal_write_object_to_filerrr
r�rr	r)rrPr�rr�rrr�test_write_object_to_file�sz'CAPI_TestCase.test_write_object_to_filecCs�ttjd��}|jd�WdQRXtjtj�\}}tjtj�|j|d�|j|d�ttjd��}|jd�WdQRX|jt	��tjtj�WdQRXtjtj�dS)Nrs4xxxxi4r�)
r
rrr�r�Zpymarshal_read_short_from_filerr	rur�)rr�r�prrr�test_read_short_from_file�sz'CAPI_TestCase.test_read_short_from_filecCs�ttjd��}|jd�WdQRXtjtj�\}}tjtj�|j|d�|j|d�ttjd��}|jd�WdQRX|jt	��tjtj�WdQRXtjtj�dS)NrsxV4xxxxixV4r�sV4)
r
rrr�r�Zpymarshal_read_long_from_filerr	rur�)rrr�r�rrr�test_read_long_from_filesz&CAPI_TestCase.test_read_long_from_filecCs�d}x�ttjd�D]�}tj||�}ttjd��}|j|d	�WdQRXtj	tj�\}}tj
tj�|j||�ttjd��}|j|dd��WdQRX|jt
��tj	tj�WdQRXtj
tj�qWdS)N�€�abcr��������F@r�y @rrsxxxx�@ @)r�r�r�r�r�)r{rr�rr
rrr�r�Z$pymarshal_read_last_object_from_filerr	rur�)rrPr�r�rr�r�rrr�test_read_last_object_from_filesz-CAPI_TestCase.test_read_last_object_from_filecCs�d}x�ttjd�D]�}tj||�}ttjd��}|j|d	�WdQRXtj	tj�\}}tj
tj�|j||�|j|t|��ttjd��}|j|dd��WdQRX|j
t��tj	tj�WdQRXtj
tj�qWdS)N�€�abcr��������F@r�y @rrsxxxx�@ @)r�r�r�r�r�)r{rr�rr
rrr�r�Zpymarshal_read_object_from_filerr	r�rur�)rrPr�r�rr�r�rrr�test_read_object_from_file%sz(CAPI_TestCase.test_read_object_from_fileN)	rrrr�r�r�r�r�r�rrrrr��s	r��__main__l)$Ztestrrlr�rrZunittestr�rMr��ImportErrorrZTestCaserr.r1r:r=rSrdror�rr�r�ZskipIfr�r�r�r�r�rRZ
skipUnlessr�r�mainrrrr�<module>sF

$
 
$?Q


Youez - 2016 - github.com/yon3zu
LinuXploit