HEX
Server: Apache
System: Linux zacp120.webway.host 4.18.0-553.50.1.lve.el8.x86_64 #1 SMP Thu Apr 17 19:10:24 UTC 2025 x86_64
User: govancoz (1003)
PHP: 8.3.26
Disabled: exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: //usr/local/lib/python3.10/test/__pycache__/test_zipimport.cpython-310.opt-1.pyc
o

�iA��@s�ddlZddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
mZddlm
Z
ddlmZddlmZmZmZmZddlZddlZddlZddlZddlZddlmZmZmZzddlZWneyudZYnwdZe edd	�Z!d
Z"dd�Z#d
d�Z$e��Z%e#e!e%e&e��Z'dZ(dZ)dZ*ej+�,d�Z-ej+�,d�Z.ej/�0e(d�Z1dZ2Gdd�dej3�Z4Gdd�de4�Z5e�6�Gdd�de5��Z7Gdd�dej3�Z8dd�Z9e:d kr�e�;�dSdS)!�N)�support)�
import_helper)�	os_helper)�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
cCs6t�|�}tjjt�ddt|�d@|d@�|}|S)Nz<iLLr���)�marshal�dumps�	importlib�util�MAGIC_NUMBER�struct�pack�int)�co�mtime�size�data�pyc�r�0/usr/local/lib/python3.10/test/test_zipimport.py�make_pyc&s
���rcCs|�tjd�S)N�.)�replace�os�sep)�pathrrr�module_path_to_dotted_name-�r$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�setUp@s

zImportHooksBaseTestCase.setUpcCsJ|jtjdd�<|jtjdd�<|jtjdd�<tj��tj|j�dSr))	r#r*r+r,r-r.rZmodules_cleanupr/r0rrr�tearDownGs

z ImportHooksBaseTestCase.tearDownN)�__name__�
__module__�__qualname__r2r3rrrrr(>sr(c@s�eZdZeZdd�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,dIdJ�Z-dKdL�Z.e�/e0j1dMudN�dOdP��Z2dQdR�Z3dSdT�Z4dUdV�Z5dWdX�Z6dMS)Y�UncompressedZipImportTestCasecCs t��tj��t�|�dSr))�	linecache�
clearcache�	zipimport�_zip_directory_cacher.r(r2r0rrrr2Ss
z#UncompressedZipImportTestCase.setUpc		Cs�|�tj|�|��D]K\}\}}tj�||�}|dtjkr+tj�|�s*t�	|�qtj�
|�}tj�|�s<t�	|�t|d��
}|�|�Wd�n1sQwYqdS)N����wb)
�
addCleanupr�rmtree�itemsr!r#�joinr"�isdir�makedirs�dirname�open�write)	r1�filesZdirName�namerrr#Zdname�fprrr�makeTreeZs
�
���z&UncompressedZipImportTestCase.makeTreecKs|�tj|�t|d��2}|��D]\}\}}t|t�|��}|j|_	|�
||�q|�dd�}	|	dur7|	|_Wd�n1sAwY|�dd�}
|
dur�t
|d��}|��}Wd�n1sdwYt
|d��}|�|
�|�|�Wd�dS1s�wYdSdS)N�w�comment�stuff�rbr=)r>r�unlinkrr@r�time�	localtime�compression�
compress_type�writestr�getrLrE�readrF)r1rGZzipName�kw�zrHrr�zinforLrM�frrr�makeZipks*��	
�
"��z%UncompressedZipImportTestCase.makeZipcOs~|j|fi|��tj�dt�t�d�|��}|�d�}|dur%||�|r=|�	�}|�
|tjjtg|�R�|�dSdS)Nrr�call)r[r*r#�insert�TEMP_ZIPr�
import_modulerArUZget_file�assertEqualr!)r1Zexpected_extrG�modulesrW�modr\�filerrr�doTest�s
�
��z$UncompressedZipImportTestCase.doTestcCs�dtjvr
|�d�dtjvrtjd=dttfi}z	|�d|d�Wnty9|jt	kr6|�
d�YdSYdSw|jtkrF|�
d�dSdS)N�zlibzzlib is a builtin modulezzlib.pyr&z&expected test to not raise ImportErrorz"expected test to raise ImportError)r*�builtin_module_namesZskipTestra�NOW�test_srcrd�ImportErrorrRr�failr�r1rGrrr�
testAFakeZlib�s



��
�z+UncompressedZipImportTestCase.testAFakeZlibcCs"tdttfi}|�d|t�dS�Nr&��TESTMODrgrhrdrkrrr�testPy��z$UncompressedZipImportTestCase.testPycCs"ttttfi}|�t|t�dSr))ro�pyc_extrg�test_pycrdrkrrr�testPyc�rqz%UncompressedZipImportTestCase.testPyccCs.tdttfttttfi}|�t|t�dSrm)rorgrhrrrsrdrkrrr�testBoth�s�z&UncompressedZipImportTestCase.testBothc�jd}tj�|�}tj�t|dd�|d�}tdtdftdtd|fi}�fd	d
�}�jd|t|d�dS)N�
state = 'old'�???r
Fr&�
state = 'new'r'�c���|jd�dS)N�old�r`�state�rbr0rr�check��zFUncompressedZipImportTestCase.testUncheckedHashBasedPyc.<locals>.check�r\�	rr�source_hash�_bootstrap_external�_code_to_hash_pyc�compilerorgrd�r1�sourcer��bytecoderGr�rr0r�testUncheckedHashBasedPyc�s
��z7UncompressedZipImportTestCase.testUncheckedHashBasedPycz_imp.check_hash_based_pycs�alwayscrv)Nrwrxr
Fr&ryr'rzcr{)N�newr}rr0rrr��r�zOUncompressedZipImportTestCase.test_checked_hash_based_change_pyc.<locals>.checkr�r�r�rr0r�"test_checked_hash_based_change_pyc�s
��z@UncompressedZipImportTestCase.test_checked_hash_based_change_pyccCs"tdtdfi}|�d|t�dS)Nr&�)rorgrdrkrrr�testEmptyPy�rqz)UncompressedZipImportTestCase.testEmptyPycC�Ftt�}|ddN<tdttfttt|fi}|�d|t�dS)Nr�r&��	bytearrayrsrorgrhrrrd)r1�badmagic_pycrGrrr�testBadMagic�s�z*UncompressedZipImportTestCase.testBadMagicc
Cs�tt�}|ddN<ttt|fi}z|�d|t�|�d�WdStjyF}z|�	|j
t�|�d|j
j
�WYd}~dSd}~ww)Nrr�r&zThis should not be reachedzmagic number)r�rsrorrrgrdrjr:�ZipImportError�assertIsInstance�	__cause__ri�assertIn�msg)r1r�rG�excrrr�
testBadMagic2�s��z+UncompressedZipImportTestCase.testBadMagic2cCr�)N��r&r�)r1Zbadtime_pycrGrrr�testBadMTime�s�z*UncompressedZipImportTestCase.testBadMTimecCs>ttdtt��}tdttfttt|fi}|�d|t�dS)Nrr&)r�test_co�lenrhrorgrrrd)r1Ztwenty_thirty_eight_pycrGrrr�
test2038MTime�s
�z+UncompressedZipImportTestCase.test2038MTimecCsBttj}|dtttf|ttttfi}|�t|tt�dS�N�__init__)�TESTPACKr!r"rrrgrsrord)r1�packdirrGrrr�testPackages

�z)UncompressedZipImportTestCase.testPackagecCsbttj}|ttj}|dtttf|dtttf|ttttfi}|�t|ttt�dSr�)	r�r!r"�	TESTPACK2rrrgrsrord�r1r��packdir2rGrrr�testSubPackages
�z,UncompressedZipImportTestCase.testSubPackagecCsRttj}|ttj}|tdf|tdf|ttttfi}|�t|ttt�dS�Nr�)	r�r!r"r�rgrorrrsrdr�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����rr<�������)r�r!r"r�rgrorrrsr#�abspathr[�TEMP_DIRrJr*r]rr_r`r��__path__�basename�splitr �listrA�__file__)
r1r�r��packdir3�files1�files2�zip1�zip2rb�p1�p2�mpath�subpkgrrr�testMixedNamespacePackage!sl
��

 �

 ��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�rr<r�r�r�)r�r!r"r�rgrorrrsr#r�r[r*r]rr_r`r�r�r�r r�rAr�)
r1r�r�r�r�r�r�r�rbr�r�r�r�rrr�testNamespacePackagens`
��



z2UncompressedZipImportTestCase.testNamespacePackagec	Cs^ttj}|ttj}|dtttf|dtttf|ttttfdtttfi}|�t	j
t�ttd��(}|�
�D]\}\}}t|t�|��}|j|_d|_|�||�q=Wd�n1scwYt�t�}	|�|	jt�|�|	�t��t���Et�dt�|	�d�}
|� |
�|�!|
tj�|�"|
�d��|
�#d�}|�|
�$d�|j%�|	�#t�}|�|	�$t�|j%�Wd�n1s�wY|	�&d�}
|� |
�|�!|
j'tj�|�"|
j'�d��t(j)�*|
�}|
j'�+|�|�|
j'�$d�|j%�|	�&t�}
t(j)�*|
�}|
j'�+|�|�|	�$t�|j%�t(�,t�j-d}tj.�/tt�}|�||�|�"|	�|d��|�|	�|t��|�"|	�|t��|t}t0|�}t(�,|�}|�|t1j2v�|�3|	�4t��|�3|	�4|��|�|	�$|�|j%�|j5j'}|�3|�4|��|�|�$|�|j%�t�ttjt�}|�|jt�|�|j6ttj�dS)Nr��spamrK�spam�ignorer)7r�r!r"r�rrrgrsror>rrOr^rr@rrPrQrRrSrLrTr:�zipimporterr`�archive�
assertTrue�
is_package�warnings�catch_warnings�simplefilter�DeprecationWarning�find_module�assertIsNotNoner��assertFalse�load_module�get_filenamer��	find_spec�loaderrr�module_from_spec�exec_moduler_r�r#rAr$r*ra�assertIsNone�
get_source�__spec__�prefix)r1r�r�rGrXrHrrrY�ziZfind_mod�load_modrb�specZexec_modZexisting_pack_pathZexpected_path_path�mod_path�mod_namer��zi2rrr�testZipImporterMethods�sx
���





�



z4UncompressedZipImportTestCase.testZipImporterMethodsc	Csttj}|ttj}|dtttf|dtttf|ttttfdtttfi}|�t	j
t�ttd��(}|�
�D]\}\}}t|t�|��}|j|_d|_|�||�q=Wd�n1scwYt�t�}	|�|	j��|���|	��|�|	j��|���dtttfi}
|�|
�ttd��(}|
�
�D]\}\}}t|t�|��}|j|_d|_|�||�q�Wd�n1s�wY|	��|�|	j��|���|	�d�}|�|�|�|jtj�t� t�|	��|�!|	j�|�"tj#�$|	j%��|�"|	�d��dS)Nr�r�rKr�Zspam2�aZname_does_not_matter)&r�r!r"r�rrrgrsror>rrOr^rr@rrPrQrRrSrLrTr:r�r`�_files�keys�invalidate_caches�updater�r�r�r��remover�r�r;rUr�)r1r�r�rGrXrHrrrYr��newfiler�rrr�testInvalidateCachessP
���

��


z2UncompressedZipImportTestCase.testInvalidateCachescCsJttj}|ttj}|dtttf|ttttfi}|�t	j
t�ttd��(}|�
�D]\}\}}t|t�|��}|j|_d|_|�||�q/Wd�n1sUwYt�ttj|�}	|�|	jt�|�|	j|�|�|	�t��t���t�dt�|	� t�}
|�|	�!t�|
j"�Wd�n1s�wY|	�#t�}t$j%�&|�}
|j'�(|
�|�|j'�!t�|
j"�|�)|	�ttjd��|�)|	�ttjt��ttj|t}t�|�}
t���6t�dt�|
�*t�}|�+|�|�,|tj�|�)|
�t��|� t�}|�|�!t�|j"�Wd�n	1�s%wY|
�#t�}|�+|�|�,|j'tj�|�)|j'�t��t$j%�&|�}|j'�(|�|�|j'�!t�|j"�ttjt}t-|�}t$�.|�}
|�|t/j0v�|�1|	�2t��|�1|	�2|��|�|	�!|�|
j"�|
j3}|�1|�2|��|�|�!|�|
j"�dS)Nr�rKseggsr�)4r�r!r"r�rrrgrsror>rrOr^rr@rrPrQrRrSrLrTr:r�r`r�r�r�r�r�r�r�r�r�r�r�r�rrr�r�r�r�r�r�r�r$r_r*rar�r��
__loader__)r1r�r�rGrXrHrrrYr�rbr�Zpkg_pathr�Zfind_mod_dottedr�r�r�r�rrr�$testZipImporterMethodsInSubDirectory*sz
���

�





��

�
zBUncompressedZipImportTestCase.testZipImporterMethodsInSubDirectorycCs�|�tjt�ttd��}|j|_d}tdd�td�D��}|�||�Wd�n1s.wYt	�
t�}|�||�|��|�
dt|��dS)NrKztestdata.datcss�|]}|VqdSr)r)�.0�xrrr�	<genexpr>ss�z<UncompressedZipImportTestCase.testGetData.<locals>.<genexpr>�zzipimporter object)r>rrOr^rrR�bytes�rangerTr:r�r`�get_datar��repr)r1rXrHrr�rrr�testGetDatans�
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r
z	some.dataz	some data)rr�rgr�rorrrd)r1�srcrrGrrr�testImporterAttrzs�z.UncompressedZipImportTestCase.testImporterAttrcCs`d}tdt|fi}|�|�tj�dt�t�t�}|�	|�
d�d�	|�	|�
d�d�dS)Nz[if 1:  # indent hack
        def test(val):
            assert(val)
            return val
r&rr�)
rorgr[r*r#r]r^rr_r`�test�assertRaises�AssertionError)r1r�rGrbrrr�testDefaultOptimizationLevel�s

z:UncompressedZipImportTestCase.testDefaultOptimizationLevelcC�&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)rMrnrkrrr�testImport_WithStuff�s

�z2UncompressedZipImportTestCase.testImport_WithStuffcCs|�t�|�t�dSr))r`�inspectZ	getsourcerh)r1�modulerrr�assertModuleSource�sz0UncompressedZipImportTestCase.assertModuleSourcecCs(tdttfi}|jd|t|jd�dS�Nr&r�)rorgrhrdrrkrrr�
testGetSource��z+UncompressedZipImportTestCase.testGetSourcecCsLtttdd�ttt��}tdttfttt|fi}|jt|t|jd�dS)Nrr
r&r�)	rr�rhrgr�rorrrdr)r1rrGrrr�testGetCompiledSource�s
�z3UncompressedZipImportTestCase.testGetCompiledSourcecCs.tdttfdtdfi}|jd|t|d�dS)Nr&�xyz.txtz>>> log.append(True)
r�rn)r1�callbackrGrrr�
runDoctest�s�z(UncompressedZipImportTestCase.runDoctestcCsLg}tjd}t_ztjd|dt�d�W|t_n|t_w|�|dg�dS�Nr	T)�packageZmodule_relativeZglobs)�doctestZmasterZtestfile�localsr`)r1r�logZ
old_masterrrr�
doDoctestFile�s�z+UncompressedZipImportTestCase.doDoctestFilecC�|�|j�dSr))rrr0rrr�testDoctestFile��z-UncompressedZipImportTestCase.testDoctestFilecCs.g}tjd|dt�d���|�|dg�dSr)rZDocFileTestr�runr`)r1rrrrr�doDoctestSuite�s�z,UncompressedZipImportTestCase.doDoctestSuitecCrr))rrr0rrr�testDoctestSuite�rz.UncompressedZipImportTestCase.testDoctestSuitec	
Cs�z	|��Wtd��ty[}zF|jj}t|d�d\}}}}|�|t���t|j	d�d\}}}}|�|t���t
��}t|d|�|�
|���t��WYd}~dSd}~ww)Nr�rzThis ought to be impossible)Zdo_raise�	Exception�
__traceback__�tb_nextr	r`�	raise_src�stripr
�tb_frame�io�StringIOrr��getvalue�endswithr�)	r1r�e�tbrZ�lno�n�line�srrr�doTraceback�s
�"��z)UncompressedZipImportTestCase.doTracebackcCs(tdttfi}|jd|t|jd�dSr)rorgrrdr(rkrrr�
testTraceback�rz+UncompressedZipImportTestCase.testTracebackNzneed an unencodable filenamecCs�tjd}|�tj|�t|d��}ttdt�t	��}|j
|_|�|t
�Wd�n1s0wYt�|��t�}tj�|�}|j�|�dS�Nz.ziprKr&)r�TESTFN_UNENCODABLEr>rOrrrorPrQrgrRrSrTrhr:r�r�rrr�r�r�)r1�filenamerXrYr�rbrrr�testUnencodable�s
�z-UncompressedZipImportTestCase.testUnencodablecCstjd}|�tj|�t|d��}ttdt�t	��}|j
|_|�|t
�Wd�n1s0wYt�|�t�t�|��|�t��t�tt�|���Wd�n1s\wY|�t��t�tt�|���Wd�dS1s|wYdSr*)rZTESTFNr>rOrrrorPrQrgrRrSrTrhr:r�r!�fsencoder��	TypeErrorr��
memoryview)r1r,rXrYrrr�
testBytesPath�s
�
�"�z+UncompressedZipImportTestCase.testBytesPathcCr)Nr&scomment�rLrnrkrrr�testComment�sz)UncompressedZipImportTestCase.testCommentcCs(tdttfi}|jd|tddd�dS)Nr&s@cruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftshi)rMrLrnrkrrr�testBeginningCruftAndComment�rz:UncompressedZipImportTestCase.testBeginningCruftAndCommentcCs*tdttfi}|jd|tddd�dS)Nr&�ci��r2rnrkrrr�testLargestPossibleCommentsz8UncompressedZipImportTestCase.testLargestPossibleComment)7r4r5r6rrRr2r�rJr^r[rdrlrprtrur��unittestZmockZpatchr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrrrrrrr(r)ZskipIfrr+r-r1r3r4r6rrrrr7Os` 
	
MII*D�
r7c@seZdZeZdS)�CompressedZipImportTestCaseN)r4r5r6rrRrrrrr8sr8c@sTeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�ZdS)�BadFileZipImportTestCasecCs|�tjtj|�dSr))r�r:r�r�)r1r,rrr�assertZipFailure
s�z)BadFileZipImportTestCase.assertZipFailurecC�|�d�dS)NZAdfjdkFJKDFJjdklfjs�r:r0rrr�
testNoFiler%z#BadFileZipImportTestCase.testNoFilecCr;r�r<r0rrr�testEmptyFilenamer%z*BadFileZipImportTestCase.testEmptyFilenamecCsB|�ttjd�|jttjtdd�|�ttjtt�t���dS)N)Zkwd)r�r/r:r�ror�r!r.r0rrr�testBadArgss

�z$BadFileZipImportTestCase.testBadArgscCs|�dd�dS)N�Ai�r<r0rrr�testFilenameTooLongr�z,BadFileZipImportTestCase.testFilenameTooLongcCs"t�t�t�t�|�t�dSr))rrOroZcreate_empty_filer:r0rrr�
testEmptyFile s

z&BadFileZipImportTestCase.testEmptyFilec
Cs�t�t�t�ttjd�}z<t�|�|�tj	��
}t�
t�Wd�n1s)wYWt�td�t�t�dSWt�td�t�t�dSt�td�t�t�w)Nri�)rrOror!rE�O_CREAT�closer�r:r�r��chmod)r1�fd�cmrrr�testFileUnreadable%s

���z+BadFileZipImportTestCase.testFileUnreadablecCs4t�t�ttd�}|�d�|��|�t�dS)N�w+Zaaaaaaaaaaaaaaaaaaaaaa)rrOrorErFrDr:)r1rIrrr�testNotZipFile3s



z'BadFileZipImportTestCase.testNotZipFilecCs�t�t�ttd�}|�t�dd��|�d�|��t�	t�}z�t
���t
�dt
�|�t|jd�Wd�n1s?wY|�t|jd�|�t|jd�|�t|jd�|�t|jd�|�t|jd�|�t|jd�|�t|jd�tj}|�|�d��|�|�d��t
���t
�dt
�|�||jd�Wd�n1s�wY|�||jd�|�t|jd�|�||jd�|�||jd�Wtj��dStj��w)NrIz=IiPKZaaaaaaaaaaaaaaaaaar��abc)rrOrorErFrrrDr:r�r�r�r�r�r�r/r�r�r�r�r��get_coder�r�r�r��OSErrorr;r.)r1rIrX�errorrrr�_testBogusZipFile;s<




�
�z*BadFileZipImportTestCase._testBogusZipFileN)r4r5r6r:r=r>r?rArBrHrJrOrrrrr9sr9cCst�t�dSr))rrOrorrrr�tearDownModule^r%rP�__main__)<r*r!rr�importlib.utilrrPr7Z
unittest.mockr�r�rZtest.supportrr�zipfilerrrrr:r8rrr�	tracebackr	r
rrerirhr�r�rrr$rgr�rsror�r�r#r�r�r^r�cache_from_sourceZpyc_filerrZTestCaser(r7Z
requires_zlibr8r9rPr4�mainrrrr�<module>sj�=R�