HEX
Server: Apache
System: Linux bd12.noc223.com 4.18.0-553.121.1.lve.el8.x86_64 #1 SMP Thu Apr 30 16:40:41 UTC 2026 x86_64
User: handcraf (1693)
PHP: 8.1.28
Disabled: NONE
Upload Files
File: //opt/alt/python312/lib64/python3.12/test/__pycache__/test_zipimport.cpython-312.pyc
�

�h�e�����ddlZddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
mZddlm
Z
ddlmZddlmZmZmZmZddlZddlZddlZddlZddlZddlmZmZmZ	ddlZdZe edd	�Z!d
Z"d�Z#d�Z$ej�Z%e#e!e%e&e��Z'd
Z(dZ)dZ*ejVjYd�Z-ejVjYd�Z.ej^jae(dz�Z1dZ2Gd�dejf�Z4Gd�de4�Z5ejl�Gd�de5��Z7Gd�dejf�Z8d�Z9e:dk(rejv�yy#e$rdZY��
wxYw)�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
c��tj|�}tjjtjddt|�dz|dz�z|z}|S)Nz<iLLr���)�marshal�dumps�	importlib�util�MAGIC_NUMBER�struct�pack�int)�co�mtime�size�data�pycs     �:/opt/alt/python312/lib64/python3.12/test/test_zipimport.py�make_pycr&sY���=�=���D��>�>�&�&����F�A���J��,�d�[�.@�	B�B�DH�I�C��J�c�B�|jtjd�S)N�.)�replace�os�sep)�paths r�module_path_to_dotted_namer'-s���<�<�����$�$r �
ziptestmodule�ziptestpackage�ziptestpackage2�	junk95142z
junk95142.zip�.py�.pycc��eZdZd�Zd�Zy)�ImportHooksBaseTestCasec��tjdd|_tjdd|_tjdd|_tjj�t
j�|_y�N)	�sysr&�	meta_path�
path_hooks�path_importer_cache�clearr�
modules_setup�modules_before��selfs r�setUpzImportHooksBaseTestCase.setUp@sT���H�H�Q�K��	����q�)����.�.��+������%�%�'�+�9�9�;��r c�&�|jtjdd|jtjdd|jtjddtjj�t
j|j�yr1)	r&r2r3r4r5r6r�modules_cleanupr8r9s r�tearDownz ImportHooksBaseTestCase.tearDownGs]���i�i�������>�>��
�
�a�� �O�O����q�����%�%�'��%�%�t�':�':�;r N)�__name__�
__module__�__qualname__r;r>�r rr/r/>s��<�<r r/c��eZdZeZd�Zefd�Zefd�Z	d�Z
d�Zd�Zd�Z
d�Zd	�Zej"j%d
d�d��Zd
�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z d�Z!d�Z"d�Z#d�Z$d�Z%d�Z&d �Z'd!�Z(d"�Z)d#�Z*d$�Z+d%�Z,d&�Z-d'�Z.ej^e0jbd(ud)�d*��Z2d+�Z3d,�Z4d-�Z5d.�Z6y()/�UncompressedZipImportTestCasec��tj�tjj	�t
j
|�yr1)�	linecache�
clearcache�	zipimport�_zip_directory_cacher6r/r;r9s rr;z#UncompressedZipImportTestCase.setUpSs0��	�����&�&�,�,�.��%�%�d�+r c�\�|jtj|�|j�D]�\}\}}tj
j
||�}|dtjk(r6tj
j|�r�_t	j|��utj
j|�}tj
j|�st	j|�t|d�5}|j|�ddd���y#1swY��xYw)N����wb)
�
addCleanupr�rmtree�itemsr$r&�joinr%�isdir�makedirs�dirname�open�write)	r:�files�dirName�namerrr&�dname�fps	         r�makeTreez&UncompressedZipImportTestCase.makeTreeZs���	
���	�(�(�'�2�#(�;�;�=�
	#��D�-�5�$��7�7�<�<���.�D��B�x�2�6�6�!��w�w�}�}�T�*��K�K��%�������-���w�w�}�}�U�+��K�K��&��$��%�#���H�H�T�N�#�#�
	#�#�#�s�D"�"D+	c��|jtj|�t|d�5}|j	�D]J\}\}}t|t
j|��}|j|_	|j||��L|jdd�}	|	�|	|_ddd�|jdd�}
|
�]t|d�5}|j�}ddd�t|d�5}|j|
�|j�ddd�yy#1swY�{xYw#1swY�NxYw#1swYyxYw)N�w�comment�stuff�rbrL)rMr�unlinkrrOr�time�	localtime�compression�
compress_type�writestr�getr^rT�readrU)r:rV�zipName�kw�zrXrr�zinfor^r_�fs            r�makeZipz%UncompressedZipImportTestCase.makeZipks,��	
���	�(�(�'�2�
�W�c�
"�	$�a�',�{�{�}�
(�#��m�u�d���d�n�n�U�&;�<��&*�&6�&6��#��
�
�5�$�'�
(��f�f�Y��-�G��"�#��	�	$����w��%�����g�t�$�
 ���v�v�x��
 ��g�t�$�
�����������
�
�
�	�	$�	$��
 �
 ��
�
�s$�A9D �D,�3#D8� D)�,D5�8Ec��|j|fi|��tjjdt�tjdj|��}|jd�}|�||�|rH|j�}|j|tjjtg|���|z�yy)Nrr"�call)rnr2r&�insert�TEMP_ZIPr�
import_modulerPrg�get_file�assertEqualr$)r:�expected_extrV�modulesrj�modrp�files        r�doTestz$UncompressedZipImportTestCase.doTest�s�������U�!�b�!�������8�$��%�%�c�h�h�w�&7�8���v�v�f�~������I���<�<�>�D����T�2�7�7�<�<��$+�")�$+�-9�$:�
;�r c��dtjvr|jd�dtjvrtjd=dtt
fi}	|j
d|d�|jtk7r|jd�yy#t$r)|jtk7r|jd�YyYywxYw)N�zlibzzlib is a builtin modulezzlib.pyr,z"expected test to raise ImportErrorz&expected test to not raise ImportError)r2�builtin_module_names�skipTestrw�NOW�test_srcrzrdr�fail�ImportErrorr	�r:rVs  r�
testAFakeZlibz+UncompressedZipImportTestCase.testAFakeZlib�s���&�S�-�-�-��M�M�4�5��S�[�[� ����F�#��S�(�O�,��	@��K�K��u�f�-�
���:�-��	�	�>�?�.��	�	D����<�/��	�	�B�C�0�	D�s�B�-C�Cc�\�tdzttfi}|jd|t�y�Nr,��TESTMODrr�rzr�s  r�testPyz$UncompressedZipImportTestCase.testPy�s$���5��3��/�2�����E�5�'�*r c�l�ttzttfi}|j	t|t�yr1)r��pyc_extr�test_pycrzr�s  r�testPycz%UncompressedZipImportTestCase.testPyc�s%���7�"�S�(�O�4�����G�U�G�,r c��tdzttfttzttfi}|jt|t�yr�)r�rr�r�r�rzr�s  r�testBothz&UncompressedZipImportTestCase.testBoth�s4���5��3��/��7�"�S�(�O�5�����G�U�G�,r c�"��d}tjj|�}tjj	t|dd�|d�}tdztdftdztdz
|fi}�fd	�}�jd|t|�
�y)N�
state = 'old'�???rFr,�
state = 'new'r-�c�>���j|jd�y)N�old�ru�state�rxr:s �r�checkzFUncompressedZipImportTestCase.testUncheckedHashBasedPyc.<locals>.check��������S�Y�Y��.r �rp�	rr�source_hash�_bootstrap_external�_code_to_hash_pyc�compiler�rrz�r:�sourcer��bytecoderVr�s`     r�testUncheckedHashBasedPycz7UncompressedZipImportTestCase.testUncheckedHashBasedPyc�s����!���n�n�0�0��8���0�0�B�B��F�E�6�*���
��
�5��3��"8��6�!�C�"�H�h�#7�9��	/����D�%��u��5r z_imp.check_hash_based_pycs�alwaysc�"��d}tjj|�}tjj	t|dd�|d�}tdztdftdztdz
|fi}�fd	�}�jd|t|�
�y)Nr�r�rFr,r�r-r�c�>���j|jd�y)N�newr�r�s �rr�zOUncompressedZipImportTestCase.test_checked_hash_based_change_pyc.<locals>.check�r�r r�r�r�s`     r�"test_checked_hash_based_change_pycz@UncompressedZipImportTestCase.test_checked_hash_based_change_pyc�s����!���n�n�0�0��8���0�0�B�B��F�E�6�*���
��
�5��3��"8��6�!�C�"�H�h�#7�9��	/����D�%��u��5r c�T�tdztdfi}|jd|t�y)Nr,�)r�rrzr�s  r�testEmptyPyz)UncompressedZipImportTestCase.testEmptyPy�s$���5��3��)�,�����D�%��)r c��tt�}|dxxdzcc<tdzttftt
zt|fi}|j
d|t�y)Nr�r,��	bytearrayr�r�rr�r�rz)r:�badmagic_pycrVs   r�testBadMagicz*UncompressedZipImportTestCase.testBadMagic�sM�� ��*���Q��4����5��3��/��7�"�S�,�$7�9�����E�5�'�*r c��tt�}|dxxdzcc<ttzt|fi}	|jd|t�|j
d�y#tj$rP}|j|jt�|jd|jj�Yd}~yd}~wwxYw)Nrr�r,zThis should not be reachedzmagic number)r�r�r�r�rrzr�rH�ZipImportError�assertIsInstance�	__cause__r��assertIn�msg)r:r�rV�excs    r�
testBadMagic2z+UncompressedZipImportTestCase.testBadMagic2�s��� ��*���Q��4����7�"�S�,�$7�8��	=��K�K��u�g�.��I�I�2�3���'�'�	=��!�!�#�-�-��=��M�M�.�#�-�-�*;�*;�<�<��	=�s�(A�B?�/AB:�:B?c��tt�}|dxxdzcc<tdzttftt
zt|fi}|j
d|t�y)N��r,r�)r:�badtime_pycrVs   r�testBadMTimez*UncompressedZipImportTestCase.testBadMTime�sO����)��	�B��4����5��3��/��7�"�S�+�$6�8�����E�5�'�*r c��ttdtt��}tdzt
tfttzt
|fi}|jd|t�y)Nrr,)r�test_co�lenr�r�rr�rz)r:�twenty_thirty_eight_pycrVs   r�
test2038MTimez+UncompressedZipImportTestCase.test2038MTime�sL��#+�7�I�s�8�}�"M���5��3��/��7�"�S�*A�$B�D�����E�5�'�*r c���ttjz}|dztztt
f|tztztt
fi}|jt|tt�y�N�__init__)�TESTPACKr$r%r�rr�r�rz)r:�packdirrVs   r�testPackagez)UncompressedZipImportTestCase.testPackagesO���R�V�V�#���:�%��/�#�x���7�"�W�,�s�H�o�?�����G�U�H�g�6r c�@�ttjz}|tztjz}|dztzt
tf|dztzt
tf|tztzt
tfi}|jt|ttt�yr�)	r�r$r%�	TESTPACK2r�rr�r�rz�r:r��packdir2rVs    r�testSubPackagez,UncompressedZipImportTestCase.testSubPackage
s|���R�V�V�#���Y�&����/���:�%��/�#�x���J�&��0�3��/��G�#�g�-��X��@��	
���G�U�H�i��Ar c��ttjz}|tztjz}|tdf|tdf|t
ztzttfi}|jt|ttt
�y�Nr�)	r�r$r%r�rr�r�r�rzr�s    r�testSubNamespacePackagez5UncompressedZipImportTestCase.testSubNamespacePackagesh���R�V�V�#���Y�&����/���3��)��C��9��G�#�g�-��X��@��	
���G�U�H�i��Ar c�8
�ttjz}|tztjz}|tzdztjz}|tdf|t
ztzttf|tdf|tdf|t
ztzttf|t
zdztzttf|t
ztzttfi}|tdf|t
zdztzttf|tdf|t
zdztzttf|t
ztzttfi}tjjd�}|j||�t}|j||�tjjd|�tjjd|�tj t�}|j#dt%|j&��|j&\}	}
|j#tjj)t�|	j+tj�d�|j#d|
j+tj�d�tj |j-tjd�dd	�}|j#d
t%|j&��t/|j&�dj+dtjz�d
}|j#|dd	|�tj dj1tt
f��}|j#d|j2j+tj�d�tj dj1tt
dzf��}|j#tjj)t�|j2j+tj�d�dj1ttf�}tj |�}|j#dt%|j&��|j&\}	}
|j#tjj)t�|	j+tj�d�|j#d|
j+tj�d�tj dj1|t
f��}|j#tjj)t�|j2j+tj�d�tj dj1|t
dzf��}|j#tjj)t�|j2j+tj�d�tj dj1|t
dzf��}|j#d|j2j+tj�d�y)
N�3r��2�	path1.ziprr����r"rK�������)r�r$r%r�rr�r�r�r&�abspathrn�TEMP_DIRr[r2rqrrsrur��__path__�basename�splitr#�listrP�__file__)
r:r�r��packdir3�files1�files2�zip1�zip2rx�p1�p2�mpath�subpkgs
             r�testMixedNamespacePackagez7UncompressedZipImportTestCase.testMixedNamespacePackage"s����R�V�V�#���Y�&����/���h�&��,�r�v�v�5���C��9��G�#�g�-��X���S�"�I��S�"�I��W�$�w�.��h���W�$�s�*�W�4�s�H�o��W�$�w�.��h��
A���C��9��G�#�c�)�G�3�c�8�_��S�"�I��W�$�s�*�W�4�s�H�o��W�$�w�.��h��	A���w�w���{�+�����V�T�"����
�
�f�d�#�	������4� �������4� ��%�%�h�/��
	
����C����-�.������B�������)�)�(�3�R�X�X�b�f�f�5E�b�5I�J�����b�h�h�r�v�v�&6�r�&:�;��%�%�h�&6�&6�r�v�v�s�&C�C�R�&H�I������C����-�.��S�\�\�"�1�%�+�+�K�"�&�&�,@�A�!�D������#�2���.��%�%�c�h�h��'�/B�&C�D������c�l�l�&8�&8����&@��&D�E��%�%�c�h�h��'�C�-�/H�&I�J��������)�)�(�3����+�+�B�F�F�3�B�7�	9����8�Y�/�0���%�%�f�-������C����-�.������B�������)�)�(�3�R�X�X�b�f�f�5E�b�5I�J�����b�h�h�r�v�v�&6�r�&:�;��%�%�c�h�h���/@�&A�B��������)�)�(�3����+�+�B�F�F�3�B�7�	9��%�%�c�h�h���#�
�/F�&G�H��������)�)�(�3����+�+�B�F�F�3�B�7�	9��%�%�c�h�h���#�
�/F�&G�H������c�l�l�&8�&8����&@��&D�Er c� �ttjz}|tztjz}|tzdztjz}|tdf|t
ztzttf|tdf|tdf|t
ztzttf|t
zdztzttf|t
ztzttfi}tjjd�}|j||�|tdf|t
zdztzttf|tdf|t
zdztzttf|t
ztzttfi}tjjd�}|j||�tjjd|�tjjd|�tjt�}|jdt!|j"��|j"\}	}
|jd|	j%tj�d�|jd|
j%tj�d�tj|j'tjd	�dd
�}|jdt!|j"��t)|j"�dj%dtjz�d}|j|dd
|�tjd	j+tt
f��}|jd|j,j%tj�d�tjd	j+tt
dzf��}|jd|j,j%tj�d�d	j+ttf�}tj|�}|jdt!|j"��|j"\}	}
|jd|	j%tj�d�|jd|
j%tj�d�tjd	j+|t
f��}|jd|j,j%tj�d
�tjd	j+|t
dzf��}|jd|j,j%tj�d
�tjd	j+|t
dzf��}|jd|j,j%tj�d
�y)Nr�r�r�r�z	path2.ziprr�r�r"rKr�r�r�)r�r$r%r�rr�r�r�r&r�rnr2rqrrsrur�r�r�r#r�rPr�)
r:r�r�r�r�r�r�r�rxr�r�r�r�s
             r�testNamespacePackagez2UncompressedZipImportTestCase.testNamespacePackageos|���R�V�V�#���Y�&����/���h�&��,�r�v�v�5���C��9��G�#�g�-��X���S�"�I��S�"�I��W�$�w�.��h���W�$�s�*�W�4�s�H�o��W�$�w�.��h��
A���w�w���{�+�����V�T�"��C��9��G�#�c�)�G�3�c�8�_��S�"�I��W�$�s�*�W�4�s�H�o��W�$�w�.��h��	A��
�w�w���{�+�����V�T�"�	������4� �������4� ��%�%�h�/��
	
����C����-�.������B�����b�h�h�r�v�v�&6�r�&:�;�����b�h�h�r�v�v�&6�r�&:�;��%�%�h�&6�&6�r�v�v�s�&C�C�R�&H�I������C����-�.��S�\�\�"�1�%�+�+�K�"�&�&�,@�A�!�D������#�2���.��%�%�c�h�h��'�/B�&C�D������c�l�l�&8�&8����&@��&D�E��%�%�c�h�h��'�C�-�/H�&I�J������c�l�l�&8�&8����&@��&D�E����8�Y�/�0���%�%�f�-������C����-�.������B�����b�h�h�r�v�v�&6�r�&:�;�����b�h�h�r�v�v�&6�r�&:�;��%�%�c�h�h���/@�&A�B������c�l�l�&8�&8����&@��&D�E��%�%�c�h�h���#�
�/F�&G�H������c�l�l�&8�&8����&@��&D�E��%�%�c�h�h���#�
�/F�&G�H������c�l�l�&8�&8����&@��&D�Er c	���ttjz}|tztjz}|dztzt
tf|dztzt
tf|tztzt
tfdtzt
tfi}|jtjt�ttd�5}|j�D]Q\}\}}t|tj |��}|j"|_d|_|j)||��S	ddd�t+j,t�}	|j/|	j0t�|j3|	j5t��t7j8�5t7j:dt<�|	j?t�}
|j/|	jAt�|
jB�ddd�|	jEd�}|jG|�|jI|jJt*j,�|jM|jJj5d��tNjPjS|�}|jJjU|�|j/|jJjAd�|jB�|	jEt�}tNjPjS|�}
|jJjU|
�|j/|	jAt�|
jB�tOjVt�jXd}
tjZj]tt�}|j/|
|�|jM|	j5|dz��|j3|	j5|tz��|jM|	j5|tz��|tz}t_|�}tOjV|�}
|j3|t`jbv�|je|	jgt��|je|	jg|��|j/|	jA|�|
jB�|
jhjJ}|je|jg|��|j/|jA|�|
jB�t+j,ttjztz�}|j/|j0t�|j/|jjttjz�y#1swY���xYw#1swY���xYw)Nr��spamr]�spam�ignorer)6r�r$r%r�r�rr�r�rMrrarrrrOrrbrcrdrer^rfrH�zipimporterru�archive�
assertTrue�
is_package�warnings�catch_warnings�simplefilter�DeprecationWarning�load_module�get_filenamer��	find_spec�assertIsNotNoner��loader�assertFalserr�module_from_spec�exec_modulersr�r&rPr'r2rw�assertIsNone�
get_source�__spec__�prefix)r:r�r�rVrkrXrrrl�zirx�spec�exec_mod�existing_pack_path�expected_path_path�mod_path�mod_namer��zi2s                   r�testZipImporterMethodsz4UncompressedZipImportTestCase.testZipImporterMethods�sA���R�V�V�#���Y�&����/���:�%��/�#�x���J�&��0�3��/��G�#�g�-��X���'�!�C��?�4��
	
���	�(�(�(�3�
�X�s�
#�	(�q�',�{�{�}�
(�#��m�u�d���d�n�n�U�&;�<��&*�&6�&6��#� '��
��
�
�5�$�'�	
(�	(��
"�
"�8�
,��������X�.�����
�
�h�/�0��
$�
$�
&�	F��!�!�(�,>�?��.�.��*�C����R�_�_�X�6����E�		F��|�|�F�#�����T�"����d�k�k�9�+@�+@�A�������/�/��7�8��>�>�2�2�4�8��������)�������1�1�&�9�8�;L�;L�M��|�|�H�%���n�n�-�-�d�3��������$��������2�C�L�L�A�&�4�4�X�>�G�G��J���W�W�\�\�(�H�=�����+�-?�@�������w��';�<�=�����
�
�g�	�&9�:�;�������x�'�'9�:�;��g�%��-�h�7���%�%�h�/������C�K�K�/�0����"�-�-��1�2����"�-�-��1�2��������2�C�L�L�A����$�$�����&�+�+�H�5�6�����,�,�X�6����E��#�#�H�r�v�v�$5��$@�A��������h�/�������X����%6�7�q	(�	(��	F�	F�s�A%W� AW%�W"�%W/c	�n�ttjz}|tztjz}|dztzt
tf|dztzt
tf|tztzt
tfdtzt
tfi}|jtjt�ttd�5}|j�D]Q\}\}}t|tj |��}|j"|_d|_|j)||��S	ddd�t+j,t�}	|j/|	j0j3�|j3��|	j5�|j/|	j0j3�|j3��dtzt
tfi}
|j7|
�ttd�5}|
j�D]Q\}\}}t|tj |��}|j"|_d|_|j)||��S	ddd�|	j5�|j/|	j0j3�|j3��|	j9d�}|j;|�|j=|j>t*j,�tj@t�|	j5�|jC|	j0�|jEt*jFjI|	jJ��|jE|	j9d��y#1swY��xxYw#1swY��HxYw)Nr�r�r]r��spam2�a�name_does_not_matter)&r�r$r%r�r�rr�r�rMrrarrrrOrrbrcrdrer^rfrHr�ru�_files�keys�invalidate_caches�updater�r�r�r��removerrrIrgr�)r:r�r�rVrkrXrrrlr�newfilers            r�testInvalidateCachesz2UncompressedZipImportTestCase.testInvalidateCaches�s����R�V�V�#���Y�&����/���:�%��/�#�x���J�&��0�3��/��G�#�g�-��X���'�!�C��?�4��	
���	�(�(�(�3�
�X�s�
#�	(�q�',�{�{�}�
(�#��m�u�d���d�n�n�U�&;�<��&*�&6�&6��#� '��
��
�
�5�$�'�	
(�	(��
"�
"�8�
,����������)�5�:�:�<�8�
������������)�5�:�:�<�8��W�$�s�H�o�6��
���W��
�X�s�
#�	(�q�'.�}�}��
(�#��m�u�d���d�n�n�U�&;�<��&*�&6�&6��#� '��
��
�
�5�$�'�	
(�	(�	������������)�5�:�:�<�8��|�|�G�$�����T�"����d�k�k�9�+@�+@�A�
�	�	�(��
����������#����)�8�8�<�<�R�Z�Z�H�I����"�,�,�'=�>�?�A	(�	(��	(�	(�s�A%N�>A%N*�N'�*N4c��
�ttjz}|tztjz}|dztzt
tf|tztzt
tfi}|jtjt�ttd�5}|j�D]Q\}\}}t|tj |��}|j"|_d|_|j)||��S	ddd�t+j,ttjz|z�}	|j/|	j0t�|j/|	j2|�|j5|	j7t��t9j:�5t9j<dt>�|	jAt�}
|j/|	jCt�|
jD�ddd�|	jGt�}tHjJjM|�}
|jNjQ|
�|j/|jNjCt�|
jD�|jS|	j7ttjzdz��|jS|	j7ttjztz��ttjz|ztz}t+j,|�}
|
jGt�}|jU|�|jW|jNt*j,�|jS|jNj7t��tHjJjM|�}|jNjQ|�|j/|jNjCt�|jD�ttjztz}tY|�}tIjZ|�}
|j5|t\j^v�|ja|	jct��|ja|	jc|��|j/|	jC|�|
jD�|
jd}|ja|jc|��|j/|jC|�|
jD�y#1swY��[xYw#1swY��`xYw)Nr�r]seggsr�)3r�r$r%r�r�rr�r�rMrrarrrrOrrbrcrdrer^rfrHr�rur�rr�r�r�r�r�r�r�r�r�r�rrrr�rrr�r�r'rsr2rwrr�
__loader__)r:r�r�rVrkrXrrrlrrxr�pkg_pathr�load_modrr
r�s                  r�$testZipImporterMethodsInSubDirectoryzBUncompressedZipImportTestCase.testZipImporterMethodsInSubDirectory%s����R�V�V�#���Y�&����/���J�&��0�3��/��G�#�g�-��X��@��	
���	�(�(�(�3�
�X�s�
#�	(�q�',�{�{�}�
(�#��m�u�d���d�n�n�U�&;�<��&*�&6�&6��#� '��
��
�
�5�$�'�	
(�	(��
"�
"�8�b�f�f�#4�w�#>�
?��������X�.�������G�,�����
�
�i�0�1�
�
$�
$�
&�	G��!�!�(�,>�?��.�.��+�C����R�_�_�Y�7����F�	G�
�|�|�I�&���n�n�-�-�d�3��������$�������1�1�)�<�c�l�l�K�������y�2�6�6�'9�J�'F�G�H�������y�2�6�6�'9�G�'C�D�E��b�f�f�$�w�.��:���#�#�H�-���}�}�W�%�����T�"����d�k�k�9�+@�+@�A�������/�/��8�9��>�>�2�2�4�8��������)�����K�K�$�$�W�-�x�/@�/@�	B��r�v�v�%��/��-�h�7���%�%�h�/������C�K�K�/�0����"�-�-�	�2�3����"�-�-��1�2��������2�C�L�L�A��������&�+�+�H�5�6�����,�,�X�6����E�c	(�	(��	G�	G�s�A%U�'AU$�U!�$U.c��|jtjt�t	td�5}|j
|_d}t
d�td�D��}|j||�ddd�tjt�}|j|j��|jdt|��y#1swY�_xYw)Nr]ztestdata.datc3� K�|]}|���y�wr1rB)�.0�xs  r�	<genexpr>z<UncompressedZipImportTestCase.testGetData.<locals>.<genexpr>ds����/�q��/�s��zzipimporter object)rMrrarrrrd�bytes�rangerfrHr�ru�get_datar��repr)r:rkrXrrs     r�testGetDataz)UncompressedZipImportTestCase.testGetData_s������	�(�(�(�3�
�X�s�
#�	#�q� �,�,�A�M�!�D��/�E�#�J�/�/�D�
�J�J�t�T�"�		#��
"�
"�8�
,������r�{�{�4�0�1��
�
�*�D��H�5�	#�	#�s�AC�Cc���d}tt|dd�tt|��}tt
zt|fdtdfi}|j
t
|t�y)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�rr�r�r�rz)r:�srcrrVs    r�testImporterAttrz.UncompressedZipImportTestCase.testImporterAttrksU��2��
�w�s�G�V�4�c�3�s�8�D���7�"�S�#�J��s�K�0�2�����G�U�G�,r c�L�d}tdzt|fi}|j|�tjjdt�tjt�}|j|jd�d�	|jt|jd�y)Nz[if 1:  # indent hack
        def test(val):
            assert(val)
            return val
r,rr�F)
r�rrnr2r&rqrrrrsru�test�assertRaises�AssertionError)r:r,rVrxs    r�testDefaultOptimizationLevelz:UncompressedZipImportTestCase.testDefaultOptimizationLevelvs|�����5��3��*�-�����U��������8�$��%�%�g�.��������!��a�(�����n�c�h�h��>r c�`�tdzttfi}|jd|td��y)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)r_r�r�s  r�testImport_WithStuffz2UncompressedZipImportTestCase.testImport_WithStuff�s0���5��3��/�2�����E�5�'�*�	�	,r c�V�|jtj|�t�yr1)ru�inspect�	getsourcer�)r:�modules  r�assertModuleSourcez0UncompressedZipImportTestCase.assertModuleSource�s������*�*�6�2�H�=r c�t�tdzttfi}|jd|t|j��y�Nr,r�)r�rr�rzr9r�s  r�
testGetSourcez+UncompressedZipImportTestCase.testGetSource�s.���5��3��/�2�����E�5�'��0G�0G��Hr c��tttdd�tt	t��}t
dzttft
tzt|fi}|jt|t
|j��y)Nr
rr,r�)	rr�r�rr�r�r�rzr9)r:rrVs   r�testGetCompiledSourcez3UncompressedZipImportTestCase.testGetCompiledSource�sY���w�x��&�9�3��H�
�N���5��3��/��7�"�S�#�J�0�����G�U�G�$�2I�2I��Jr c�p�tdzttfdtdfi}|jd|t|��y)Nr,�xyz.txtz>>> log.append(True)
r�r�)r:�callbackrVs   r�
runDoctestz(UncompressedZipImportTestCase.runDoctest�s5���5��3��/��S�":�;�=�����E�5�'���9r c���g}tjdc}t_	tjd|dt���|t_|j	|dg�y#|t_wxYw�Nr@T)�package�module_relative�globs)�doctest�master�testfile�localsru)r:r8�log�
old_masters    r�
doDoctestFilez+UncompressedZipImportTestCase.doDoctestFile�s^����%,�^�^�T�"�
�G�N�	(�����6�4��h�
�
(�G�N�����d�V�$��(�G�N�s�!A � 
A-c�:�|j|j�yr1)rBrNr9s r�testDoctestFilez-UncompressedZipImportTestCase.testDoctestFile�s������*�*�+r c��g}tjd|dt���j�|j	|dg�yrD)rH�DocFileTestrK�runru)r:r8rLs   r�doDoctestSuitez,UncompressedZipImportTestCase.doDoctestSuite�s<��������v�t��(�	
��#�%�����d�V�$r c�:�|j|j�yr1)rBrTr9s r�testDoctestSuitez.UncompressedZipImportTestCase.testDoctestSuite�s������+�+�,r c�P�	|j�td��#t$r�}|jj}t|d�d\}}}}|j
|tj��t|jd�d\}}}}|j
|tj��tj�}t|d|�|j|j�j!t#j$�rdnd��Yd}~yd}~wwxYw)NzThis ought to be impossibler�rz$    def do_raise(): raise TypeError
z$                    ^^^^^^^^^^^^^^^
)�do_raiser1�	Exception�
__traceback__�tb_nextr
ru�	raise_src�stripr�tb_frame�io�StringIOrr��getvalue�endswithr�has_no_debug_ranges)	r:r8�e�tbrm�lno�n�line�ss	         r�doTracebackz)UncompressedZipImportTestCase.doTraceback�s���	@��O�O��$!�!>�?�?��#�	����(�(�B�%�b�!�,�Q�/�L�A�c�!�D����T�9�?�?�#4�5�(����a�8��;�L�A�c�!�D����T�9�?�?�#4�5����
�A��R��A���O�O�A�J�J�L�1�1��1�1�3��7��
�
��	�s��	D%�C5D � D%c�t�tdzttfi}|jd|t|j��yr;)r�rr\rzrjr�s  r�
testTracebackz+UncompressedZipImportTestCase.testTraceback�s/���5��3�	�"2�3�����D�%��t�/?�/?��@r Nzneed an unencodable filenamec��tjdz}|jtj|�t	|d�5}ttdztjt��}|j|_|j|t�ddd�tj|�j!t�}t"j$j'|�}|j(j+|�y#1swY�lxYw�Nz.zipr]r,)r�TESTFN_UNENCODABLErMrarrr�rbrcrrdrerfr�rHr�r�rrrr�r)r:�filenamerkrlrrxs      r�testUnencodablez-UncompressedZipImportTestCase.testUnencodable�s����/�/�&�8�����	�(�(�(�3�
�X�s�
#�	(�q��G�e�O�T�^�^�C�-@�A�E�"&�"2�"2�E��
�J�J�u�h�'�	(��$�$�X�.�8�8��A���n�n�-�-�d�3��������$�
	(�	(�s
�AC=�=Dc��tjdz}|jtj|�t	|d�5}ttdztjt��}|j|_|j|t�ddd�tj|�|j!t"�5tjt%j&|��ddd�|j!t"�5tjt)t%j&|���ddd�|j!t"�5tjt+t%j&|���ddd�y#1swY��xYw#1swY��xYw#1swY�rxYw#1swYyxYwrn)r�TESTFNrMrarrr�rbrcrrdrerfr�rHr�r0�	TypeErrorr$�fsencoder��
memoryview)r:rprkrls    r�
testBytesPathz+UncompressedZipImportTestCase.testBytesPath�sR���#�#�f�,�����	�(�(�(�3�
�X�s�
#�	(�q��G�e�O�T�^�^�C�-@�A�E�"&�"2�"2�E��
�J�J�u�h�'�	(�
	���h�'�
�
�
�y�
)�	9��!�!�"�+�+�h�"7�8�	9�
�
�
�y�
)�	D��!�!�)�B�K�K��,A�"B�C�	D�
�
�
�y�
)�	E��!�!�*�R�[�[��-B�"C�D�	E�	E�	(�	(��	9�	9��	D�	D��	E�	E�s1�AF�)F!�
2F-�2F9�F�!F*�-F6�9Gc�`�tdzttfi}|jd|td��y)Nr,scomment�r^r�r�s  r�testCommentz)UncompressedZipImportTestCase.testComment�s(���5��3��/�2�����E�5�'�:��>r c�b�tdzttfi}|jd|tdd��y)Nr,s@cruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftcruftshi)r_r^r�r�s  r�testBeginningCruftAndCommentz:UncompressedZipImportTestCase.testBeginningCruftAndComment�s*���5��3��/�2�����E�5�'����Nr c�f�tdzttfi}|jd|tddz��y)Nr,�ci��ryr�r�s  r�testLargestPossibleCommentz8UncompressedZipImportTestCase.testLargestPossibleComment�s-���5��3��/�2�����E�5�'�4�=�3I��Jr )7r?r@rArrdr;r�r[rrrnrzr�r�r�r�r��unittest�mock�patchr�r�r�r�r�r�r�r�r�r�r�rrrr*r-r2r4r9r<r>rBrNrPrTrVrjrl�skipIfrrorqrwrzr|rrBr rrDrDOsF���K�,�'/�#�"&.��0;� @�B+�-�-�
6��]�]���5�x�@�6�A�6�*�+�
=�+�+�7�B�	B�KF�ZGF�RA8�F(@�T8F�t
6�	-�-� ,�>�I�K�:�

%�,�%�-�@�,A��X�_�_�Y�1�1�T�9�3�5�	%�5�	%�E� ?�O�Kr rDc��eZdZeZy)�CompressedZipImportTestCaseN)r?r@rAr	rdrBr rr�r��s���Kr r�c��eZdZd�Zd�Zd�Zd�Zd�Zd�Ze	jejd�d��Z
d	�Zd
�Zy)�BadFileZipImportTestCasec�b�|jtjtj|�yr1)r0rHr�r�)r:rps  r�assertZipFailurez)BadFileZipImportTestCase.assertZipFailures#�����)�2�2�#�/�/��	;r c�&�|jd�y)N�AdfjdkFJKDFJjdklfjs�r�r9s r�
testNoFilez#BadFileZipImportTestCase.testNoFiles�����3�4r c�&�|jd�yr�r�r9s r�testEmptyFilenamez*BadFileZipImportTestCase.testEmptyFilename
s�����b�!r c	�.�|jttjd�|jttjtd��|jttjtt
jt���y)N)�kwd)r0rtrHr�r�r�r$rur9s r�testBadArgsz$BadFileZipImportTestCase.testBadArgs
s`�����)�Y�%:�%:�D�A����)�Y�%:�%:�G���N����)�Y�%:�%:��r�{�{�7�3�4�	6r c�,�|jddz�y)N�Ai�r�r9s r�testFilenameTooLongz,BadFileZipImportTestCase.testFilenameTooLongs�����c�E�k�*r c��tjt�tjt�|j	t�yr1)rrar��create_empty_filer�r9s r�
testEmptyFilez&BadFileZipImportTestCase.testEmptyFiles,������!��#�#�G�,����g�&r zmode 000 not supported.c�$�tjt�tjttj
d�}	tj|�|jtj�5}tjt�ddd�tjtd�tjt�y#1swY�=xYw#tjtd�tjt�wxYw)Nri�)rrar�r$rT�O_CREAT�closer0rHr�r��chmod)r:�fd�cms   r�testFileUnreadablez+BadFileZipImportTestCase.testFileUnreadables�������!�
�W�W�W�b�j�j�#�
.��		&��H�H�R�L��"�"�9�#;�#;�<�
/���%�%�g�.�
/�

�H�H�W�e�$����W�%�

/�
/��

�H�H�W�e�$����W�%�s$�4C�8C�C�C�C�5Dc���tjt�ttd�}|j	d�|j�|j
t�y)N�w+�aaaaaaaaaaaaaaaaaaaaaa)rrar�rTrUr�r�)r:rZs  r�testNotZipFilez'BadFileZipImportTestCase.testNotZipFile*s?������!�
�'�4�
 ��
�����
���
����g�&r c�@�tjt�ttd�}|j	tjdd��|j	d�|j�tjt�}	tj�5tjdt�|jt|j d�ddd�|jt|j"d�|jt|j$d�|jt|j&d�|jt|j(d�|jt|j*d�|jt|j,d�|jt|j.d�tj0}|j3|j%d��tj�5tjdt�|j||j d�ddd�|j||j*d�|jt4|j,d�|j||j.d�|j||j(d�tj6j9�y#1swY��xYw#1swY��xYw#tj6j9�wxYw)Nr�z=IiPK�aaaaaaaaaaaaaaaaaar��abc)rrar�rTrUrrr�rHr�r�r�r�r�r0rtr��find_moduler�rr��get_coder(rr�r�OSErrorrIr6)r:rZrk�errors    r�_testBogusZipFilez*BadFileZipImportTestCase._testBogusZipFile2s0������!�
�'�4�
 ��
������T�:�.�/�
�����
���
��!�!�'�*��	3��(�(�*�
B��%�%�h�0B�C��!�!�)�Q�]�]�D�A�
B�
���i�����=����i����d�;����i�����=����i����t�<����i����T�:����i����T�:����i����t�<��,�,�E����a�k�k�%�0�1��(�(�*�
?��%�%�h�0B�C��!�!�%�����>�
?�
���e�Q�Z�Z��7����g�q�z�z�5�9����e�Q�\�\�5�9����e�Q�\�\�5�9��*�*�0�0�2�-
B�
B��
?�
?��
�*�*�0�0�2�s>�
K=�<K$�D3K=�
8K1�BK=�$K.�)K=�1K:�6K=�= LN)r?r@rAr�r�r�r�r�r�r�r�r�is_wasir�r�r�rBr rr�r�sQ��;�5�"�6�+�'�
�X�_�_�W�_�_�&?�@�&�A�&�'�3r r�c�6�tjt�yr1)rrar�rBr r�tearDownModuler�Ts��
���W�r �__main__)<r2r$rr�importlib.utilrrbr��
unittest.mockr�r/r�test.supportrr�zipfilerrrr	rHrFrHr6r_�	tracebackr
rrr|r�r�r�r�r\rr'rr�r�r�r�r�r&r�r�rrr�cache_from_source�pyc_filer��TestCaser/rD�
requires_zlibr�r�r�r?�mainrBr r�<module>r�s~��
�	����
������&�"�>�>�����	�9�9������(�G�V�
,��/�	��%��d�i�i�k���G�S�#�h�-�0�������	�
�7�7�?�?�;�'��
�7�7�?�?�?�+���>�>�+�+�G�e�O�<��
��<�h�/�/�<�"k
K�$;�k
K�\������"?����O3�x�0�0�O3�d��z���H�M�M�O���}���D��s�&E*�*E5�4E5