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_zipimport.cpython-36.pyc
3

x2_�q�@szddlZddlZddlZddlZddlZddlZddlZddlZddlm	Z	ddl
mZmZm
Z
mZddlZddlZddlZddlZddlZddlmZmZmZdZeedd�ZdZd	d
�Zdd�Zej�Zeeeee��Z d
Z!dZ"dZ#ej$j%d�Z&ej$j%d�Z'ej(j)e!d�Z*dZ+Gdd�dej,�Z-Gdd�de-�Z.e	j/Gdd�de.��Z0Gdd�dej,�Z1dd�Z2e3dk�rve2�dS)�N)�support)�ZipFile�ZipInfo�
ZIP_STORED�ZIP_DEFLATED)�
extract_tb�
extract_stack�print_tbzHdef get_name():
    return __name__
def get_file():
    return __file__
z<???>�execz def do_raise(): raise TypeError
cCsbtj|�}t|�td�kr<|dkr,t|�}ntdt|��}tjjtjdt|�|d@�|}|S)Ngi���lz<iil��l����)	�marshal�dumps�type�int�	importlib�util�MAGIC_NUMBER�struct�pack)�co�mtime�size�data�pyc�r�8/opt/alt/python36/lib64/python3.6/test/test_zipimport.py�make_pycs

"rcCs|jtjd�S)N�.)�replace�os�sep)�pathrrr�module_path_to_dotted_name*sr!Z
ziptestmoduleZziptestpackageZziptestpackage2Z	junk95142z
junk95142.zipz.pyz.pycc@seZdZdd�Zdd�ZdS)�ImportHooksBaseTestCasecCsHtjdd�|_tjdd�|_tjdd�|_tjj�tj�|_dS)N)	�sysr �	meta_path�
path_hooks�path_importer_cache�clearrZ
modules_setup�modules_before)�selfrrr�setUp=s

zImportHooksBaseTestCase.setUpcCsJ|jtjdd�<|jtjdd�<|jtjdd�<tjj�tj|j�dS)N)	r r#r$r%r&r'rZmodules_cleanupr()r)rrr�tearDownDs

z ImportHooksBaseTestCase.tearDownN)�__name__�
__module__�__qualname__r*r+rrrrr";sr"c@sJeZdZeZdd�Zefdd�Zefdd�Z	dd�Z
d	d
�Zdd�Zd
d�Z
dd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zd-d.�Zd/d0�Zd1d2�Zd3d4�Z d5d6�Z!d7d8�Z"d9d:�Z#d;d<�Z$d=d>�Z%d?d@�Z&dAdB�Z'dCdD�Z(e)j*e+j,dEkdF�dGdH��Z-dIdJ�Z.dES)K�UncompressedZipImportTestCasecCs tj�tjj�tj|�dS)N)�	linecache�
clearcache�	zipimport�_zip_directory_cacher'r"r*)r)rrrr*Ps
z#UncompressedZipImportTestCase.setUpc	
Cs�|jtj|�x�|j�D]�\}\}}tjj||�}|dtjkrXtjj|�s�tj	|�qtjj
|�}tjj|�sztj	|�t|d��}|j|�WdQRXqWdS)N��wb���)
�
addCleanuprZrmtree�itemsrr �joinr�isdir�makedirs�dirname�open�write)	r)�filesZdirName�namerrr Zdname�fprrr�makeTreeWs
z&UncompressedZipImportTestCase.makeTreecKs�|jtj|�t|d��D}x<|j�D]0\}\}}t|tj|��}|j|_	|j
||�q$WWdQRX|jdd�}	|	dk	r�t|d��}
|
j
�}WdQRXt|d��}
|
j|	�|
j|�WdQRXdS)N�w�stuff�rbr5)r7r�unlinkrr8r�time�	localtime�compression�
compress_type�writestr�getr=�readr>)r)r?ZzipName�kw�zr@rr�zinforD�frrr�makeZiphs
z%UncompressedZipImportTestCase.makeZipcOst|j|f|�tjjdt�tjdj|��}|jd�}|dk	rF||�|rp|j	�}|j
|tjjtf|��|�dS)Nrr�call)rRr#r �insert�TEMP_ZIPr�
import_moduler9rLZget_file�assertEqualr)r)Zexpected_extr?�modulesrN�modrS�filerrr�doTest}s
z$UncompressedZipImportTestCase.doTestcCs�dtjkr|jd�dtjkr&tjd=dttfi}y|jd|d�Wn(tk
rl|jt	krh|j
d�YnX|jtkr�|j
d�dS)N�zlibzzlib is a builtin modulezzlib.pyz.pyz&expected test to not raise ImportErrorz"expected test to raise ImportError)r#�builtin_module_namesZskipTestrX�NOW�test_srcr[�ImportErrorrIr�failr)r)r?rrr�
testAFakeZlib�s




z+UncompressedZipImportTestCase.testAFakeZlibcCs"tdttfi}|jd|t�dS)Nz.py)�TESTMODr^r_r[)r)r?rrr�testPy�sz$UncompressedZipImportTestCase.testPycCs"ttttfi}|jt|t�dS)N)rc�pyc_extr^�test_pycr[)r)r?rrr�testPyc�sz%UncompressedZipImportTestCase.testPyccCs.tdttfttttfi}|jt|t�dS)Nz.py)rcr^r_rerfr[)r)r?rrr�testBoth�sz&UncompressedZipImportTestCase.testBothcCs"tdtdfi}|jd|t�dS)Nz.py�)rcr^r[)r)r?rrr�testEmptyPy�sz)UncompressedZipImportTestCase.testEmptyPycCsFtt�}|ddN<tdttfttt|fi}|jd|t�dS)Nr�z.py)�	bytearrayrfrcr^r_rer[)r)�badmagic_pycr?rrr�testBadMagic�s
z*UncompressedZipImportTestCase.testBadMagiccCs^tt�}|ddN<ttt|fi}y|jd|t�Wntk
rNYnX|jd�dS)Nrrkz.pyz)expected ImportError; import from bad pyc)rlrfrcrer^r[r`ra)r)rmr?rrr�
testBadMagic2�sz+UncompressedZipImportTestCase.testBadMagic2cCsFtt�}|ddN<tdttfttt|fi}|jd|t�dS)N��z.py)rlrfrcr^r_rer[)r)Zbadtime_pycr?rrr�testBadMTime�s
z*UncompressedZipImportTestCase.testBadMTimecCsBttj}|dtttf|ttttfi}|jt|tt�dS)N�__init__)�TESTPACKrrrer^rfrcr[)r)�packdirr?rrr�testPackage�s
z)UncompressedZipImportTestCase.testPackagecCsbttj}|ttj}|dtttf|dtttf|ttttfi}|jt|ttt�dS)Nrs)	rtrr�	TESTPACK2rer^rfrcr[)r)ru�packdir2r?rrr�testSubPackage�s
z,UncompressedZipImportTestCase.testSubPackagecCsRttj}|ttj}|tdf|tdf|ttttfi}|jt|ttt�dS)Nri)	rtrrrwr^rcrerfr[)r)rurxr?rrr�testSubNamespacePackage�s
z5UncompressedZipImportTestCase.testSubNamespacePackagec
CsRttj}|ttj}|tdtj}|tdf|ttttf|tdf|tdf|ttttf|tdtttf|ttttfi}|tdf|tdtttf|tdf|tdtttf|ttttfi}tjj	d�}|j
||�t}|j||�t
jjd|�t
jjd|�tjt�}|jdt|j��|j\}	}
|jtjjt�|	jtj�d�|jd|
jtj�d�tj|jtjd�dd
��}|jdt|j��t|j�djdtj�d}|j|dd�|�tjdjttf��}|jd|jjtj�d�tjdjttdf��}|jtjjt�|jjtj�d�djttf�}tj|�}|jdt|j��|j\}	}
|jtjjt�|	jtj�d�|jd|
jtj�d�tjdj|tf��}|jtjjt�|jjtj�d�tjdj|tdf��}|jtjjt�|jjtj�d�tjdj|tdf��}|jd|jjtj�d�dS)N�3ri�2z	path1.ziprrqrr4�rk���r~r6r6���rrr���r�r�)rtrrrwr^rcrerfr �abspathrR�TEMP_DIRrBr#rTrrVrW�len�__path__�basename�splitr�listr9�__file__)
r)rurx�packdir3�files1�files2�zip1�zip2rY�p1�p2�mpath�subpkgrrr�testMixedNamespacePackage�sb


 

 z7UncompressedZipImportTestCase.testMixedNamespacePackagec
Cs2ttj}|ttj}|tdtj}|tdf|ttttf|tdf|tdf|ttttf|tdtttf|ttttfi}tjj	d�}|j
||�|tdf|tdtttf|tdf|tdtttf|ttttfi}tjj	d�}|j
||�tjjd|�tjjd|�t
jt�}|jdt|j��|j\}	}
|jd|	jtj�d�|jd|
jtj�d
�t
j|jtjd�dd��}|jd	t|j��t|j�djdtj�d	}|j|dd�|�t
jdjttf��}|jd|jjtj�d�t
jdjttdf��}|jd|jjtj�d�djttf�}t
j|�}|jdt|j��|j\}	}
|jd|	jtj�d�|jd|
jtj�d�t
jdj|tf��}|jd|jjtj�d�t
jdj|tdf��}|jd|jjtj�d�t
jdj|tdf��}|jd|jjtj�d�dS)Nr{riz	path1.zipr|z	path2.ziprrqrr4r}rkr~r~r6r6rrrrr�r�r�)rtrrrwr^rcrerfr r�rRr#rTrrVrWr�r�r�rr�r9r�)
r)rurxr�r�r�r�r�rYr�r�r�r�rrr�testNamespacePackageCs\




z2UncompressedZipImportTestCase.testNamespacePackagecCs�ttj}|ttj}|dtttf|dtttf|ttttfdtttfi}tt	d�}�zxB|j
�D]6\}\}}t|tj
|��}|j|_d|_|j||�qpW|j�tjt	�}	|j|	jt	�|j|	jt�d�|	jd�}
|j|
�|j|
tj�|j|
jd��|
jd�}|j|
jd�|j�|	jt�}|j|	jt�|j�tj t�j!d}
tj"j#t	t�}|j|
|�|j|	j|d�d�|j|	j|t�d�|j|	j|t�d�|t}t$|�}tj |�}|j%|t&j'k�|j|	j(t�d�|j|	j(|�d�|j|	j|�|j�|j)}|j|j(|�d�|j|j|�|j�tjt	tjt�}|j|jt	�|j|j*ttj�Wd|j�tj+t	�XdS)NrsZspamrCsspamTrF),rtrrrwrer^rfrcrrUr8rrGrHrIrJ�commentrK�closer2�zipimporterrW�archive�
is_package�find_module�assertIsNotNone�assertIsInstance�assertFalse�load_module�get_filenamer�rrVr�r r9r!�
assertTruer#rX�
get_source�
__loader__�prefix�remove)r)rurxr?rOr@rrrP�ziZfind_mod�load_modrYZexisting_pack_pathZexpected_path_path�mod_path�mod_name�loader�zi2rrr�testZipImporterMethods�s\







z4UncompressedZipImportTestCase.testZipImporterMethodscCsJttj}|ttj}|dtttf|ttttfi}tt	d�}�z�xB|j
�D]6\}\}}t|tj
|��}|j|_d|_|j||�qTW|j�tjt	tj|�}	|j|	jt	�|j|	j|�|j|	jt�d�|	jt�}
|j|	jt�|
j�|j|	jttjd�d�|j|	jttjt�d�t	tj|t}tj|�}|jt�}
|j|
�|j|
tj�|j|jt��|
jt�}|j|
jt�|j�ttjt}t |�}t!j"|�}
|j#|t$j%k�|j|	j&t�d�|j|	j&|�d�|j|	j|�|
j�|
j'}|j|j&|�d�|j|j|�|
j�Wd|j�tj(t	�XdS)NrsrCseggsTF))rtrrrwrer^rfrcrrUr8rrGrHrIrJr�rKr�r2r�rWr�r�r�r�r�r�r�r�r�r�r!rrVr�r#rXr�r�r�)r)rurxr?rOr@rrrPr�rYZpkg_pathr�Zfind_mod_dottedr�r�r�r�rrr�$testZipImporterMethodsInSubDirectory�sV







zBUncompressedZipImportTestCase.testZipImporterMethodsInSubDirectorycCs�ttd�}|j|_z^d}tdd�td�D��}|j||�|j�tjt�}|j	||j
|��|jdt|��Wd|j�t
jt�XdS)NrCztestdata.datcss|]
}|VqdS)Nr)�.0�xrrr�	<genexpr>sz<UncompressedZipImportTestCase.testGetData.<locals>.<genexpr>�zzipimporter object)rrUrI�bytes�rangerKr�r2r�rW�get_dataZassertIn�reprrr�)r)rOr@rr�rrr�testGetData�s

z)UncompressedZipImportTestCase.testGetDatacCstGdd�dt�}ttd�}z@d}d}|j||�|j�tjt�}|j||j||���Wd|j�t	j
t�XdS)Nc@seZdZdd�ZdS)z?UncompressedZipImportTestCase.test_issue31291.<locals>.FunnyStrcSsdS)N�*r)r)�old�newrrrrszGUncompressedZipImportTestCase.test_issue31291.<locals>.FunnyStr.replaceN)r,r-r.rrrrr�FunnyStrsr�rCz
test31291.datsfoo)�strrrUrKr�r2r�rWr�rr�)r)r�rOr@rr�rrr�test_issue31291s

z-UncompressedZipImportTestCase.test_issue31291cCsFd}tt|dd�tt|��}ttt|fdtdfi}|jt|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")
z<???>r
z	some.dataz	some data)r�compiler^r�rcrer[)r)�srcrr?rrr�testImporterAttrs
z.UncompressedZipImportTestCase.testImporterAttrcCs\d}tdt|fi}|j|�tjjdt�tjt�}|j	|j
d�d�|jt|j
d�dS)Nz[if 1:  # indent hack
        def test(val):
            assert(val)
            return val
z.pyrr4F)
rcr^rRr#r rTrUrrVrW�test�assertRaises�AssertionError)r)r�r?rYrrr�testDefaultOptimizationLevel(s

z:UncompressedZipImportTestCase.testDefaultOptimizationLevelcCs*tdttfi}|jd|tddd�dS)Nz.pys
Some Stuff�)rD)rcr^r_r[)r)r?rrr�testImport_WithStuff5s
z2UncompressedZipImportTestCase.testImport_WithStuffcCs|jtj|�t�dS)N)rW�inspectZ	getsourcer_)r)�modulerrr�assertModuleSource<sz0UncompressedZipImportTestCase.assertModuleSourcecCs(tdttfi}|jd|t|jd�dS)Nz.py)rS)rcr^r_r[r�)r)r?rrr�
testGetSource?sz+UncompressedZipImportTestCase.testGetSourcecCsLtttdd�ttt��}tdttfttt|fi}|jt|t|jd�dS)Nz<???>r
z.py)rS)	rr�r_r^r�rcrer[r�)r)rr?rrr�testGetCompiledSourceCsz3UncompressedZipImportTestCase.testGetCompiledSourcecCs.tdttfdtdfi}|jd|t|d�dS)Nz.pyzxyz.txtz>>> log.append(True)
)rS)rcr^r_r[)r)�callbackr?rrr�
runDoctestIsz(UncompressedZipImportTestCase.runDoctestcCsFg}tjd}t_ztjd|dt�d�Wd|t_X|j|dg�dS)Nzxyz.txtT)�package�module_relative�globs)�doctestZmasterZtestfile�localsrW)r)r��logZ
old_masterrrr�
doDoctestFileNsz+UncompressedZipImportTestCase.doDoctestFilecCs|j|j�dS)N)r�r�)r)rrr�testDoctestFileZsz-UncompressedZipImportTestCase.testDoctestFilecCs.g}tjd|dt�d�j�|j|dg�dS)Nzxyz.txtT)r�r�r�)r�ZDocFileTestr�ZrunrW)r)r�r�rrr�doDoctestSuite]s
z,UncompressedZipImportTestCase.doDoctestSuitecCs|j|j�dS)N)r�r�)r)rrr�testDoctestSuiteesz.UncompressedZipImportTestCase.testDoctestSuitec
Cs�y|j�Wn�tj�dj}t|d�d\}}}}|j|tj��t|j	d�d\}}}}|j|tj��t
j�}t|d|�|j
|j�jt��Yn
Xtd��dS)Nrqr4rzThis ought to be impossible)Zdo_raiser#�exc_info�tb_nextrrW�	raise_src�stripr�tb_frame�io�StringIOr	r��getvalue�endswithr�)r)r��tbrQZlno�n�line�srrr�doTracebackhsz)UncompressedZipImportTestCase.doTracebackcCs(tdttfi}|jd|t|jd�dS)Nz.py)rS)rcr^r�r[r�)r)r?rrr�
testTracebackzsz+UncompressedZipImportTestCase.testTracebackNzneed an unencodable filenamecCsjtjd}t|d�}ttdtjt��}|j|_	|j
|t�|j�zt
j|�jt�Wdtj|�XdS)Nz.ziprCz.py)r�TESTFN_UNENCODABLErrrcrGrHr^rIrJrKr_r�r2r�r�rr�)r)�filenamerOrPrrr�testUnencodable~s

z-UncompressedZipImportTestCase.testUnencodablecCs�tjd}|jtj|�t|d��.}ttdtjt	��}|j
|_|j|t
�WdQRXtj|�tjtj|��|jt��tjttj|���WdQRX|jt��tjttj|���WdQRXdS)Nz.ziprCz.py)rZTESTFNr7rFrrrcrGrHr^rIrJrKr_r2r�r�fsencodeZassertWarns�DeprecationWarningrl�
memoryview)r)r�rOrPrrr�
testBytesPath�s

z+UncompressedZipImportTestCase.testBytesPath)/r,r-r.rrIr*r�rBrUrRr[rbrdrgrhrjrnrorrrvryrzr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r��unittestZskipIfrr�r�r�rrrrr/LsL 	
MI<5

r/c@seZdZeZdS)�CompressedZipImportTestCaseN)r,r-r.rrIrrrrr��sr�c@sTeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�ZdS)�BadFileZipImportTestCasecCs|jtjtj|�dS)N)r�r2�ZipImportErrorr�)r)r�rrr�assertZipFailure�sz)BadFileZipImportTestCase.assertZipFailurecCs|jd�dS)NZAdfjdkFJKDFJjdklfjs)r�)r)rrr�
testNoFile�sz#BadFileZipImportTestCase.testNoFilecCs|jd�dS)Nri)r�)r)rrr�testEmptyFilename�sz*BadFileZipImportTestCase.testEmptyFilenamecCsB|jttjd�|jttjtdd�|jttjttjt���dS)N)Zkwd)r��	TypeErrorr2r�rcr�rr�)r)rrr�testBadArgs�s
z$BadFileZipImportTestCase.testBadArgscCs|jdd�dS)N�Ai�)r�)r)rrr�testFilenameTooLong�sz,BadFileZipImportTestCase.testFilenameTooLongcCs"tjt�tjt�|jt�dS)N)rrFrcZcreate_empty_filer�)r)rrr�
testEmptyFile�s

z&BadFileZipImportTestCase.testEmptyFilecCshtjt�tjttjd�}z0tj|�|jtj	��}tj
t�WdQRXWdtjtd�tjt�XdS)Nri�)rrFrcrr=�O_CREATr�r�r2r�r��chmod)r)�fd�cmrrr�testFileUnreadable�s

z+BadFileZipImportTestCase.testFileUnreadablecCs8tjt�ttd�}|jdd�|j�|jt�dS)Nzw+�a�)rrFrcr=r>r�r�)r)rArrr�testNotZipFile�s


z'BadFileZipImportTestCase.testNotZipFilec
Cs tjt�ttd�}|jtjdd��|jd�|j�tj	t�}z�|j
t|jd�|j
t|j
d�|j
t|jd�|j
t|jd�|j
t|jd�|j
t|jd�tj}|j|jd�d�|j
||j
d�|j
||jd�|j
t|jd�|j
||jd�|j
||jd�Wdtjj�XdS)Nzw+z=IiPKr���abcZaaaaaaaaaaaaaaaaaa)rrFrcr=r>rrr�r2r�r�r�r�r�r��get_coder�r�r�rW�OSErrorr3r')r)rArO�errorrrr�_testBogusZipFile�s*



z*BadFileZipImportTestCase._testBogusZipFileN)r,r-r.r�r�r�r�r�r�r�r�rrrrrr��sr�cCs$ztjttt�Wdtjt�XdS)N)rZrun_unittestr/r�r�rFrcrrrr�	test_main�s
r�__main__)4r#rrr�importlib.utilrrGr�r�rZzipfilerrrrr2r0r�r�r��	tracebackrrr	r_r�Ztest_cor�rr!r^r�rfrcrtrwr r�r�rUr�cache_from_sourceZpyc_filereZTestCaser"r/Z
requires_zlibr�r�rr,rrrr�<module>sRTK



Youez - 2016 - github.com/yon3zu
LinuXploit