AlkantarClanX12

Your IP : 18.223.206.84


Current Path : /proc/self/root/opt/alt/python311/lib64/python3.11/__pycache__/
Upload File :
Current File : //proc/self/root/opt/alt/python311/lib64/python3.11/__pycache__/zipfile.cpython-311.opt-2.pyc

�

c��f\n���	ddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
Z
ddlZddlZ	ddlZejZn#e$rdZejZYnwxYw	ddlZn
#e$rdZYnwxYw	ddlZn
#e$rdZYnwxYwgd�ZGd�de��ZGd�de��ZexZZdZdZdZdZd	Zd
Z dZ!dZ"d
Z#dZ$dZ%dZ&dZ'dZ(e
j)e'��Z*dZ+dZ,dZ-dZ.dZ/dZ0dZ1dZ2d	Z3dZ4dZ5dZ6e
j)e5��Z7dZ8dZ9dZ:dZ;dZ<dZ=dZ>dZ?d	Z@dZAdZBdZCd
ZDdZEdZFdZGd ZHd!ZId"ZJdZKdZLd	ZMd#ZNd$ZOd%ZPd&ZQd'ZRe
j)eQ��ZSdZTdZUdZVdZWdZXdZYdZZdZ[d	Z\dZ]dZ^dZ_d(Z`d)Zae
j)e`��Zbd*Zcd+Zde
j)ec��ZedZfdZgdZhdZidZjdZkdZldZmd	ZndZod,Zpe
jqd-��Zrd.�Zsd/�Ztd0�Zud1�Zvd2�ZwGd3�d4ex��Zydazd5�Z{d6�Z|Gd7�d8��Z}Gd9�d:��Z~idd;�dd<�dd=�dd=�dd=�dd=�dd>�dd?�d	d@�ddA�dd>�d
dB�ddC�d"dD�dEdF�dGdH�dIdJ�ZdK�Z�dfdL�Z�dM�Z�GdN�dO��Z�GdP�dQ��Z�GdR�dSej���Z�GdT�dUej���Z�GdV�dW��Z�GdX�dYe���Z�dZ�Z�d[�Z�e�j�Z�	d\�Z�Gd]�d^e���Z�Gd_�d`e���Z�dfda�Z�Gdb�dc��Z�dfdd�Z�e�dekre���dSdS)g�N)
�
BadZipFile�
BadZipfile�error�
ZIP_STORED�ZIP_DEFLATED�	ZIP_BZIP2�ZIP_LZMA�
is_zipfile�ZipInfo�ZipFile�	PyZipFile�LargeZipFile�Pathc��eZdZdS)rN��__name__�
__module__�__qualname__���./opt/alt/python311/lib64/python3.11/zipfile.pyrr,s�������Drrc��eZdZdS)rNrrrrrr0s�������rri���������-�.�?s<4s4H2LHsPK��������	z<4s4B4HL2L5H2LsPK�
��
����� �@iz<4s2B4HL2L2HsPKz<4sLQLsPKz
<4sQ2H2L4QsPKiPK�<HHc��tj}d}g}dx}}|dzt|��krd||||dz���\}}|dz|z}	||vr'||kr|�|||���|	}d}|	}|dzt|��k�d|s|S|t|��kr|�||d���d�|��S)NFrr$Tr)�_EXTRA_FIELD_STRUCT�unpack�len�append�join)
�extra�xidsr5�modified�buffer�start�i�xid�xlen�js
          r�_strip_extrarB�s���
 �
'�F��H�
�F��M�E�A�
�a�%�3�u�:�:�
�
��F�5��Q��U��+�,�,�	��T�
��E�D�L���$�;�;��E�z�z��
�
�e�E�A�I�.�/�/�/��E��H�
���a�%�3�u�:�:�
�
�������E�
�
����
�
�e�E�F�F�m�$�$�$��8�8�F���rc�L�	t|��rdSn#t$rYnwxYwdS)NTF)�_EndRecData�OSError��fps r�_check_zipfilerH�sD��
��r�?�?�	��4�	���
�
�
���
�����5s��
!�!c���	d}	t|d��rt|���}n7t|d��5}t|��}ddd��n#1swxYwYn#t$rYnwxYw|S)NF�readrF�rb)�hasattrrH�openrE)�filename�resultrGs   rr
r
�s�����F�
��8�V�$�$�	,�#�x�0�0�0�F�F��h��%�%�
,��'��+�+��
,�
,�
,�
,�
,�
,�
,�
,�
,�
,�
,����
,�
,�
,�
,����
�
�
���
�����Ms4�1A�A�A�A�A�A�A�
A+�*A+c
��		|�|tz
d��n#t$r|cYSwxYw|�t��}t	|��tkr|Stjt|��\}}}}|tkr|S|dks|dkrtd���|�|tz
tz
d��|�t��}t	|��tkr|Stjt|��\
}}}	}
}}}
}}}|tkr|S||t<||t<||t<|
|t <||t"<||t$<||t&<|S)Nr"rr!z3zipfiles that span multiple disks are not supported)�seek�sizeEndCentDir64LocatorrErJr6�structr5�structEndArchive64Locator�stringEndArchive64Locatorr�sizeEndCentDir64�structEndArchive64�stringEndArchive64�_ECD_SIGNATURE�_ECD_DISK_NUMBER�_ECD_DISK_START�_ECD_ENTRIES_THIS_DISK�_ECD_ENTRIES_TOTAL�	_ECD_SIZE�_ECD_OFFSET)�fpin�offset�endrec�data�sig�diskno�reloff�disks�sz�create_version�read_version�disk_num�disk_dir�dircount�	dircount2�dirsize�	diroffsets                 r�
_EndRecData64rq�s������	�	�&�2�2�A�6�6�6�6�������
�
�
�����
�9�9�,�-�-�D�
�4�y�y�+�+�+��
�!'��/H�$�!O�!O��C����
�'�'�'��
�
��{�{�e�a�i�i��N�O�O�O�	�I�I�f�.�.�1A�A�1�E�E�E��9�9�%�&�&�D�
�4�y�y�$�$�$��
�	�
�(�$�/�/�0�C��^�\�8�X��)�W�i�
� � � ��
�!�F�>��'�F���&�F�?��%-�F�!�"�!*�F����F�9��#�F�;���Ms�"�1�1c��	|�dd��|���}	|�td��n#t$rYdSwxYw|���}t|��tkr�|dd�tkr�|dd�dkrrtjt|��}t|��}|�d��|�|tz
��t|t|��St|dz
tz
d��}|�|d��|���}|�t��}|dkr�|||tz�}t|��tkrdSttjt|����}|t}||tz|tz|z�}|�|��|�||z��t|||z|z
|��SdS)Nrr"r$���sri)rQ�tell�sizeEndCentDirrErJr6�stringEndArchiverSr5�structEndArchive�listr7rq�max�rfind�_ECD_COMMENT_SIZE)	r`�filesizercrb�maxCommentStartr=�recData�commentSize�comments	         rrDrDs$��M�	�I�I�a��O�O�O��y�y�{�{�H�
��	�	�>�/�1�%�%�%�%�������t�t������9�9�;�;�D��D�	�	�^�#�#��Q�q�S�	�%�%�%��R�S�S�	�[� � ���/��6�6���F�|�|��	�
�
�c�����
�
�h��/�0�0�0��T�N�?�F�;�;�;��(�g�.��?��C�C�O��I�I�o�q�!�!�!��9�9�;�;�D��J�J�'�(�(�E���z�z��u�U�>�1�1�2���w�<�<�>�)�)��4��f�m�$4�g�>�>�?�?���.�/���u�^�+�E�.�,@��,L�L�M���
�
�g�����
�
�o��-�.�.�.��T�?�U�#:�X�#E�#�%�%�	%��4s�A
�

A�Ac�Z�eZdZ	dZdd�Zd�Zdd�Zd�Zd	�Ze	dd
d�d���Z
d
�ZdS)r)�
orig_filenamerN�	date_time�
compress_type�_compresslevelr�r9�
create_systemri�extract_version�reserved�	flag_bits�volume�
internal_attr�
external_attr�
header_offset�CRC�
compress_size�	file_size�	_raw_time�_end_offset�NoName��r!r!rrrc�f�||_|�td����}|dkr
|d|�}tjdkr.tj|vr |�tjd��}||_||_|ddkrtd���t|_
d|_d|_d|_
tjdkrd|_nd|_t"|_t"|_d|_d|_d|_d|_d|_d|_d|_d|_dS)Nr�/r�z+ZIP does not support timestamps before 1980r�win32r#)r��find�chr�os�sep�replacerNr��
ValueErrorrr�r�r�r9�sys�platformr��DEFAULT_VERSIONrir�r�r�r�r�r�r�r�r�)�selfrNr��	null_bytes    r�__init__zZipInfo.__init__vs*��%����M�M�#�a�&�&�)�)�	���>�>���)��,�H��6�S�=�=�R�V�x�/�/��'�'����4�4�H� ��
�"����Q�<�$����J�K�K�K�(���"��������
��<�7�"�"�!"�D���"#�D��-���.�����
�����������������������rc���d|jj�d|j��g}|jtkr;|�dt�|j|j��z��|jdz	}|jdz}|r*|�dtj
|��z��|r|�d|z��|���}|r|jr|�d|jz��|r|j
r=|jtks|j|j
kr|�d	|j
z��|�d
��d�|��S)N�<z
 filename=� compress_type=%sr-rz filemode=%rz external_attr=%#xz
 file_size=%rz compress_size=%r�>�)�	__class__rrNr�rr7�compressor_names�getr��stat�filemode�is_dirr�r�r8)r�rO�hi�lo�isdirs     r�__repr__zZipInfo.__repr__�s{���'+�~�'>�'>�'>��
�
�N�O�����+�+��M�M�-�*�.�.�t�/A�/3�/A�C�C�C�
D�
D�
D��
�2�
%��
�
�&�
(��
�	>��M�M�.�4�=��+<�+<�<�=�=�=�
�	5��M�M�.��3�4�4�4����
�
���	<���	<��M�M�/�D�N�:�;�;�;��	D�$�,�	D�
�
�:�
-�
-�
�^�t�1�
1�
1��M�M�-��0B�B�C�C�C��
�
�c�����w�w�v���rNc��	|j}|ddz
dz|ddzz|dz}|ddz|d	dzz|ddzz}|jtzrdx}x}}n|j}|j}|j}|j}d}	|�|tkp
|tk}|r=d
}
|tj	|
dtj
|
��d	z
||��z}d}d}t}	|jtkrtt|	��}	n%|jt krtt"|	��}	t|	|j��|_t|	|j��|_|���\}}tj	t*t,|j|j||j|||||t1|��t1|���
�
}
|
|z|zS)Nrr�r(r!r%r"r#r*r$z<HHQQ���)r�r��_MASK_USE_DATA_DESCRIPTORr�r�r�r9�ZIP64_LIMITrS�pack�calcsize�
ZIP64_VERSIONr�rry�
BZIP2_VERSIONr	�LZMA_VERSIONr�ri�_encodeFilenameFlags�structFileHeader�stringFileHeaderr�r6)r��zip64�dt�dosdate�dostimer�r�r�r9�min_version�fmtrNr��headers              r�
FileHeaderzZipInfo.FileHeader�s���	��^���a�5�4�<�A�%��1���
�2�R��U�:���Q�%�2�+��1���
�*�b��e�q�j�9���>�5�5�	'�./�/�C�/�-�)�)��(�C� �.�M���I��
�����=���+�J�}�{�/J�E��	(��C��F�K��()�6�?�3�+?�+?��+A�9�m�]�]�]�E�"�I�&�M�'�K����*�*��m�[�9�9�K�K�
�
�8�
+�
+��l�K�8�8�K�"�;��0D�E�E���!�+�t�/B�C�C���"�7�7�9�9���)���-�/?�!�1�4�=�)�!�/��'�3�*�I� ��]�]�C��J�J�	8�8��
�� �5�(�(rc��	|j�d��|jfS#t$r,|j�d��|jtzfcYSwxYw)N�ascii�utf-8)rN�encoder��UnicodeEncodeError�_MASK_UTF_FILENAME�r�s rr�zZipInfo._encodeFilenameFlags�sm��	V��=�'�'��0�0�$�.�@�@��!�	V�	V�	V��=�'�'��0�0�$�.�CU�2U�U�U�U�U�	V���s� #�3A�Ac��|j}tj}t|��dk�r*|d|dd���\}}|dzt|��krt	d||fz���|dkr�|d|dz�}	|jdvr'd}|d|dd���\|_|dd�}|jd	kr'd
}|d|dd���\|_|dd�}|jd	krd}|d|dd���\|_n'#tj$rt	d|�d
���d�wxYw||dzd�}t|��dk��(dSdS)Nr$r2z"Corrupt extra field %04x (size=%d)r!)l����r�z	File sizez<Qrr�z
Compress sizez
Header offsetzCorrupt zip64 extra field. z not found.)	r9rSr5r6rr�r�r�r)r�r9r5�tp�lnrc�fields       r�_decodeExtrazZipInfo._decodeExtra�s����
������%�j�j�A�o�o��V�E�5��!��9�-�-�F�B���!�t�c�%�j�j� � � �!E��R��!P�Q�Q�Q��V�|�|��Q�r�!�t�V�}��F��~�)M�M�M� +��*0�&��t�B�Q�B�x�*@�*@����#�A�B�B�x���)�[�8�8� /��.4�f�T�4����8�.D�.D�+��*�#�A�B�B�x���)�[�8�8� /��.4�f�T�4����8�.D�.D�+��*����|�F�F�F�$�&;�(-�&;�&;�&;�<�<�AE�F�F�����"�Q�$�%�%�L�E�/�%�j�j�A�o�o�o�o�o�os
�=B
D�$D,T��strict_timestampsc��	t|tj��rtj|��}tj|��}t	j|j��}tj|j	��}|dd�}|s|ddkrd}n|s|ddkrd}|�|}tj
�tj
�|��d��}|dtj
tjfvr*|dd�}|dtj
tjfv�*|r|dz
}|||��}|jd	zd
z|_|rd|_|xjd
zc_n|j|_|S)Nrr&r�r��;)r�r���;r�r!r�rr-)�
isinstancer��PathLike�fspathr��S_ISDIR�st_mode�time�	localtime�st_mtime�path�normpath�
splitdriver��altsepr�r��st_size)	�clsrN�arcnamer��str��mtimer��zinfos	         r�	from_filezZipInfo.from_files��	��h���,�,�	+��y��*�*�H�
�W�X�
�
����R�Z�(�(����r�{�+�+���!�A�#�J�	� �	3�Y�q�\�D�%8�%8�-�I�I�"�	3�y��|�d�':�':�2�I��?��G��'�"�"�2�7�#5�#5�g�#>�#>�q�#A�B�B���a�j�R�V�R�Y�/�/�/��a�b�b�k�G��a�j�R�V�R�Y�/�/�/��	��s�N�G���G�Y�'�'��!�z�F�2�r�9����	)��E�O����4�'���� �j�E�O��rc���	|j�d��rdStjjr:|j�tjjtjjf��SdS)Nr�TF)rN�endswithr�r�r�r�r�s rr�zZipInfo.is_dir1sY��@��=�!�!�#�&�&�	��4�
�7�>�	I��=�)�)�2�7�;����*G�H�H�H��ur)r�r��N)rrr�	__slots__r�r�r�r�r��classmethodr�r�rrrrr[s�������H��I�0' �' �' �' �X���,.)�.)�.)�.)�`V�V�V�!�!�!�:�#�D�#�#�#�#��[�#�J
�
�
�
�
rrc�P�td��D]}|dzr	|dz	dz}�|dz}�|S)Nrr!l q[)�range)�crcrAs  r�_gen_crcr�CsC��
�1�X�X������7�	��!�8�z�)�C�C��A�I�C�C��Jrc���������d�d�d�t�/tttt	d������at��fd������fd��|D]
}�|�����fd�}|S)NixV4i�gE#i�xV4�c�.��	|dz	�||zdzzS)Nr�r)�chr��crctables  �r�crc32z_ZipDecrypter.<locals>.crc32]s#���6��q��H�c�B�h�$�%6�7�7�7rc�j���|������dzzdz��dzdzdz���dz	����dS)Nr�r�i�r!�r)�cr��key0�key1�key2s ����r�update_keysz"_ZipDecrypter.<locals>.update_keysasR����u�Q��~�~����t��$�
�2���y� �1�$�
�2���u�T�R�Z��&�&���rc���	t��}|j}|D].}�dz}|||dzzdz	dzz}�|��||���/t|��S)Nr"r!rr�)�	bytearrayr7�bytes)rcrOr7r�krrs     ��r�	decrypterz _ZipDecrypter.<locals>.decrypterksr���%���������	�	�A��q��A�
�1��!��9��"�d�*�*�A��K��N�N�N��F�1�I�I�I�I��V�}�}�r)�	_crctablerx�mapr�r�)	�pwd�pr	r�r�rrrrs	   @@@@@@r�
_ZipDecrypterrSs����������D��D��D�����X�u�S�z�z�2�2�3�3�	��H�8�8�8�8�8�'�'�'�'�'�'�'�'�������A�����	�	�	�	�	�	��rc�&�eZdZd�Zd�Zd�Zd�ZdS)�LZMACompressorc��d|_dSr�)�_compr�s rr�zLZMACompressor.__init__{s
����
�
�
rc��tjdtji��}tjtjtjtj|��g���|_tjdddt|����|zS)N�id��filtersz<BBHr(r$)
�lzma�_encode_filter_properties�FILTER_LZMA1r�
FORMAT_RAW�_decode_filter_propertiesrrSr�r6)r��propss  r�_initzLZMACompressor._init~ss���.��d�6G�/H�I�I���(����*�4�+<�e�D�D�C
�����
��{�6�1�a��U���4�4�u�<�<rc��|j�/|���|j�|��zS|j�|��Sr�)rr�compress)r�rcs  rrzLZMACompressor.compress�sC���:���:�:�<�<�$�*�"5�"5�d�";�";�;�;��z�"�"�4�(�(�(rc��|j�.|���|j���zS|j���Sr�)rr�flushr�s rr!zLZMACompressor.flush�s?���:���:�:�<�<�$�*�"2�"2�"4�"4�4�4��z���!�!�!rN)rrrr�rrr!rrrrrysP���������=�=�=�)�)�)�
"�"�"�"�"rrc��eZdZd�Zd�ZdS)�LZMADecompressorc�0�d|_d|_d|_dS)NrF)�_decomp�_unconsumed�eofr�s rr�zLZMADecompressor.__init__�s������������rc
��|j��|xj|z
c_t|j��dkrdStjd|jdd���\}t|j��d|zkrdStjt
jtjt
j	|jdd|z���g���|_|jd|zd�}|`|j�
|��}|jj|_|S)Nr$rz<Hr"r)r%r&r6rSr5rr#rrr�
decompressr')r�rc�psizerOs    rr)zLZMADecompressor.decompress�s���<������$����4�#�$�$��)�)��s��]�4��)9�!�A�#�)>�?�?�F�E��4�#�$�$��E�	�1�1��s��0����.�t�/@�/3�/?��!�e�)��/L�N�N�K����D�L��#�A��I�J�J�/�D�� ���(�(��.�.���<�#����
rN)rrrr�r)rrrr#r#�s2���������
����rr#�store�shrink�reduce�implode�tokenize�deflate�	deflate64�bzip2r�terse��lz77�a�wavpack�b�ppmdc��|tkrdS|tkrtstd���dS|tkrt
std���dS|tkrtstd���dStd���)Nz.Compression requires the (missing) zlib modulez-Compression requires the (missing) bz2 modulez.Compression requires the (missing) lzma modulez(That compression method is not supported)	rr�zlib�RuntimeErrorr�bz2r	r�NotImplementedError)�compressions r�_check_compressionr@�s����j� � ���	��	$�	$��	B��@�B�B�
B�	B�	B�
�	�	!�	!��	A��?�A�A�
A�	A�	A�
��	 �	 ��	B��@�B�B�
B�	B�	B�"�"L�M�M�Mrc�N�|tkrL|� tj|tjd��Stjtjtjd��S|t
kr)|�t
j|��St
j��S|tkrt��SdS)N��)
rr;�compressobj�DEFLATED�Z_DEFAULT_COMPRESSIONrr=�
BZ2Compressorr	r)r��
compresslevels  r�_get_compressorrH�s�����$�$��$��#�M�4�=�#�F�F�F���� :�D�M�3�O�O�O�	�)�	#�	#��$��$�]�3�3�3�� �"�"�"�	�(�	"�	"������trc�l�t|��|tkrdS|tkrtjd��S|t
krt
j��S|tkrt��St�|��}|rtd||fz���td|fz���)NrBzcompression type %d (%s)zcompression type %d)
r@rrr;�
decompressobjrr=�BZ2Decompressorr	r#r�r�r>)r��descrs  r�_get_decompressorrM�s����}�%�%�%��
�"�"��t�	�,�	&�	&��!�#�&�&�&�	�)�	#�	#��"�$�$�$�	�(�	"�	"��!�!�!� �$�$�]�3�3���	P�%�&@�M�SX�CY�&Y�Z�Z�Z�%�&;�}�>N�&N�O�O�Orc�0�eZdZd�Zd�Zd	d�Zd
d�Zd�ZdS)�_SharedFilec�d�||_||_||_||_||_|j|_dSr�)�_file�_pos�_close�_lock�_writing�seekable)r��file�pos�close�lock�writings      rr�z_SharedFile.__init__�s2����
���	������
���
��
��
�
�
rc��|jSr�)rRr�s rrtz_SharedFile.tell�s
���y�rrc�
�|j5|���rtd���|j�||��|j���|_|jcddd��S#1swxYwYdS)Nz}Can't reposition in the ZIP file while there is an open writing handle on it. Close the writing handle before trying to read.)rTrUr�rQrQrtrR)r�ra�whences   rrQz_SharedFile.seeks���
�Z�	�	��}�}���
K� �"J�K�K�K�
�J�O�O�F�F�+�+�+��
���)�)�D�I��9�	�	�	�	�	�	�	�	�	�	�	�	����	�	�	�	�	�	s�A#A8�8A<�?A<���c�<�|j5|���rtd���|j�|j��|j�|��}|j���|_|cddd��S#1swxYwYdS)N�yCan't read from the ZIP file while there is an open writing handle on it. Close the writing handle before trying to read.)rTrUr�rQrQrRrJrt�r��nrcs   rrJz_SharedFile.reads���
�Z�	�	��}�}���
K� �"J�K�K�K�
�J�O�O�D�I�&�&�&��:�?�?�1�%�%�D��
���)�)�D�I��	�	�	�	�	�	�	�	�	�	�	�	����	�	�	�	�	�	s�A<B�B�Bc�^�|j�%|j}d|_|�|��dSdSr�)rQrS)r��fileobjs  rrYz_SharedFile.closes8���:�!��j�G��D�J��K�K�� � � � � �"�!rN�r�r_)rrrr�rtrQrJrYrrrrOrO�si������&�&�&��������	�	�	�	�!�!�!�!�!rrOc�,�eZdZd�Zd�Zd�Zd�Zd�ZdS)�	_Tellablec�"�||_d|_dS�Nr)rGra�r�rGs  rr�z_Tellable.__init__s���������rc�Z�|j�|��}|xj|z
c_|Sr�)rG�writera)r�rcrcs   rrnz_Tellable.write"s*���G�M�M�$�������q�����rc��|jSr�)rar�s rrtz_Tellable.tell's
���{�rc�8�|j���dSr�)rGr!r�s rr!z_Tellable.flush*�����
�
�����rc�8�|j���dSr�)rGrYr�s rrYz_Tellable.close-rqrN)rrrr�rnrtr!rYrrrriris_������������
����������rric���eZdZ	dZdZdZ		dd�Zd�Zd�Zdd
�Z	dd�Z
d
�Zdd�Zd�Z
d�Zd�Zd�Z�fd�Zd�Zdd�Zd�Z�xZS)�
ZipExtFilei@iiNFc�&�||_||_||_|j|_|j|_|j|_t|j��|_
d|_d|_d|_
d|_||_|j|_t%|d��r!|j|_t+d��|_nd|_d|_	|���rD|���|_|j|_|j|_|j|_d|_n#t<$rYnwxYwd|_|r[|j tBzr|j"dz	dz}n
|jdz	dz}|�#��}||krtId	|j%z���dSdS)
NFrrr�Trr�r�zBad password for file %r)&�_fileobj�_pwd�_close_fileobjr��_compress_typer��_compress_leftr��_leftrM�
_decompressor�_eof�_readbuffer�_offset�newlines�moderN�namerLr��
_expected_crcr��_running_crc�	_seekablerVrt�_orig_compress_start�_orig_compress_size�_orig_file_size�_orig_start_crc�AttributeError�
_decrypterr�r�r��_init_decrypterr<r�)r�rer��zipinfor�
close_fileobj�
check_byte�hs        rr�zZipExtFile.__init__?s�����
���	�+���%�3���%�3����&��
�.�t�/B�C�C�����	���������
���	��$��	��7�E�"�"�	&�!(��D�� %�c�
�
�D���!%�D�����	����!�!�
&�,3�L�L�N�N��)�+2�+@��(�'.�'8��$�'+�'8��$�!%������	�	�	��D�	��������		W�� �#<�<�
8�%�/�1�4��<�
�
�&�k�R�/�4�7�
��$�$�&�&�A��J���"�#=��@U�#U�V�V�V�		W�		W��s�AD�
D(�'D(c��t|j��|_|j�d��}|xjdzc_|�|��dS)Nrr*)rrwr�rvrJrz)r�r�s  rr�zZipExtFile._init_decrypterrsU��'��	�2�2�����#�#�B�'�'�����r�!������v�&�&�r�*�*rc��d|jj�d|jj��g}|jsq|�d|j�d|j����|jtkr;|�dt�
|j|j��z��n|�d��|�d��d�|��S)	Nr��.z name=z mode=r��	 [closed]r�r�)r�rr�closedr7r�r�ryrr�r�r8�r�rOs  rr�zZipExtFile.__repr__}s����"�n�7�7�7�"�n�9�9�;�<���{�	'��M�M�M��	�	�	�4�9�9�E�F�F�F��"�j�0�0��
�
�1�.�2�2�4�3F�37�3F�H�H�H�I�I�I��
�M�M�+�&�&�&��
�
�c�����w�w�v���rr_c���	|dkrF|j�d|j��dz}|dkr|j|j|�}||_|Stj�||��S)Nr�
r!)r~r�r�io�BufferedIOBase�readline)r��limitr>�lines    rr�zZipExtFile.readline�sr��	�
�1�9�9�� �%�%�e�T�\�:�:�Q�>�A��1�u�u��'���a��8�� ������ �)�)�$��6�6�6rr!c�X�	|t|j��|jz
krn|�|��}t|��|jkr$||j|jd�z|_d|_n|xjt|��zc_|j|j|jdz�S)Nri)r6r~rrJ)r�rc�chunks   r�peekzZipExtFile.peek�s���D��s�4�#�$�$�t�|�3�3�3��I�I�a�L�L�E��5�z�z�D�L�(�(�#(�4�+;�D�L�M�M�+J�#J�� � ��������E�
�
�*�������d�l�S�.@� @�A�Arc�2�|jrtd���dS)N�I/O operation on closed file.T)r�r�r�s r�readablezZipExtFile.readable�s ���;�	>��<�=�=�=��trc��	|jrtd���|�|dkrO|j|jd�}d|_d|_|js$||�|j��z
}|j�$|S||jz}|t|j��kr|j|j|�}||_|S|t|j��z
}|j|jd�}d|_d|_|dkro|jsh|�|��}|t|��kr||_||_||d|�z
}n$||z
}|t|��z}|dkr|j�h|S)Nzread from closed file.rr)r�r�r~rr}�_read1�MAX_Nr6)r�rc�buf�endrcs     rrJzZipExtFile.read�s}��	��;�	7��5�6�6�6��9��A����"�4�<�=�=�1�C�"�D���D�L��i�
/��t�{�{�4�:�.�.�.���i�
/��J��$�,�����T�%�&�&�&�&��"�4�<��#3�4�C��D�L��J��#�d�&�'�'�'����t�|�}�}�-���������!�e�e�D�I�e��;�;�q�>�>�D��3�t�9�9�}�}�#'�� � ����t�B�Q�B�x�����4�K�C�
��T���N�A��!�e�e�D�I�e��
rc��|j�dSt||j��|_|jr'|j|jkrt	d|jz���dSdS)NzBad CRC-32 for file %r)r�r�r�r}rr�)r��newdatas  r�_update_crczZipExtFile._update_crc�sh����%��F�!�'�4�+<�=�=����9�	C��*�d�.@�@�@��5��	�A�B�B�B�	C�	C�@�@rc�p�	|�|dkrT|j|jd�}d|_d|_|js)|�|j��}|r||z
}n|j�)|S||jz}|t|j��kr|j|j|�}||_|S|t|j��z
}|j|jd�}d|_d|_|dkrZ|jsS|�|��}|t|��kr||_||_||d|�z
}n|r||z
}n|j�S|S�Nrr)r~rr}r�r�r6)r�rcr�rcr�s     r�read1zZipExtFile.read1�sl��E��9��A����"�4�<�=�=�1�C�"�D���D�L��i�
��{�{�4�:�.�.�����4�K�C��	�i�
�
�J��$�,�����T�%�&�&�&�&��"�4�<��#3�4�C��D�L��J��#�d�&�'�'�'����t�|�}�}�-���������q�5�5��i�	
��{�{�1�~�~���s�4�y�y�=�=�'+�D�$�#$�D�L��4����8�O�C�����4�K�C���i�	
��
rc�l�|js|dkrdS|jtkrH|jj}|t|��kr(||�|t|��z
��z
}n|�|��}|jtkr|jdk|_n�|jtkr}t||j
��}|j�||��}|jjp|jdko|jj|_|jr||j�
��z
}n6|j�|��}|jjp
|jdk|_|d|j�}|xjt|��zc_|jdkrd|_|�|��|S)NrrT)r}ryrr|�unconsumed_tailr6�_read2rrzry�
MIN_READ_SIZEr)r'r!r{r�rbs   rr�zZipExtFile._read1�s����9�	��Q����3���,�.�.��%�5�D��3�t�9�9�}�}�����A��D�	�	�M�2�2�2����;�;�q�>�>�D���*�,�,��+�q�0�D�I�I�
�
 �L�
0�
0��A�t�)�*�*�A��%�0�0��q�9�9�D��+�/�@��,��1�@�!�/�?�?�
�I��y�
3���*�0�0�2�2�2����%�0�0��6�6�D��*�.�J�$�2E��2J�D�I��K�T�Z�K� ���
�
�c�$�i�i��
�
��:��?�?��D�I���������rc�,�|jdkrdSt||j��}t||j��}|j�|��}|xjt
|��zc_|st�|j�|�|��}|Sr�)	rzryr��minrvrJr6�EOFErrorr�rbs   rr�zZipExtFile._read2#s�����!�#�#��3���4�%�&�&����4�&�'�'���}�!�!�!�$�$�����s�4�y�y�(����	��N��?�&��?�?�4�(�(�D��rc����	|jr|j���t�����dS#t�����wxYwr�)rxrvrY�super�r�r�s �rrYzZipExtFile.close3sR���	��"�
&��
�#�#�%�%�%��G�G�M�M�O�O�O�O�O��E�G�G�M�M�O�O�O�O���s� A�"A'c�<�|jrtd���|jS�Nr�)r�r�r�r�s rrVzZipExtFile.seekable:s#���;�	>��<�=�=�=��~�rrc�^�|jrtd���|jstjd���|���}|dkr|}n,|dkr||z}n |dkr|j|z}ntd���||jkr|j}|dkrd}||z
}||jz}|dkr"|t|j	��kr
||_d}n�|dkr�|j
�|j��|j
|_|j|_|j|_d|_	d|_t%|j��|_d|_|}|j�|���|dkr5t1|j|��}|�|��||z}|dk�5|���S)	Nzseek on closed file.�!underlying stream is not seekablerr!r"zCwhence must be os.SEEK_SET (0), os.SEEK_CUR (1), or os.SEEK_END (2)rF)r�r�r�r��UnsupportedOperationrtr�rr6r~rvrQr�r�r�r�rzr{rMryr|r}r�r�r��
MAX_SEEK_READrJ)r�rar^�curr_pos�new_pos�read_offset�buff_offset�read_lens        rrQzZipExtFile.seek?s����;�	5��3�4�4�4��~�	O��)�*M�N�N�N��9�9�;�;���Q�;�;��G�G�
�q�[�[���'�G�G�
�q�[�[��*�V�3�G�G��C�D�D�
D��T�)�)�)��*�G��Q�;�;��G���(��!�D�L�0���!����c�$�2B�.C�.C� C� C�&�D�L��K�K�
�1�_�_��M���t�8�9�9�9� $� 4�D��"&�":�D���-�D�J�"�D���D�L�!2�4�3F�!G�!G�D���D�I�!�K���*��$�$�&�&�&��A�o�o��4�-�{�;�;�H��I�I�h�����8�#�K��A�o�o�
�y�y�{�{�rc��|jrtd���|jstjd���|j|jz
t|j��z
|j	z}|S)Nztell on closed file.r�)
r�r�r�r�r�r�r{r6r~r)r��fileposs  rrtzZipExtFile.tellqsc���;�	5��3�4�4�4��~�	O��)�*M�N�N�N��&���3�c�$�:J�6K�6K�K�d�l�Z���r)NFrg�r!rf)rrrr�r�r�r�r�r�r�r�r�rJr�r�r�r�rYrVrQrt�
__classcell__�r�s@rrtrt1sS��������

�E��M��M�37�$�0W�0W�0W�0W�f	+�	+�	+����7�7�7�7� B�B�B�B����
!�!�!�!�FC�C�C�#�#�#�J"�"�"�H��� ��������
0�0�0�0�d������rrtc�F��eZdZd�Zed���Zd�Zd�Z�fd�Z�xZ	S)�
_ZipWriteFilec��||_||_||_t|j|j��|_d|_d|_d|_	dSrk)
�_zinfo�_zip64�_zipfilerHr�r��_compressor�
_file_size�_compress_size�_crc)r��zfr�r�s    rr�z_ZipWriteFile.__init__{sP����������
�*�5�+>�+0�+?�A�A�����������	�	�	rc��|jjSr�)r�rGr�s rrvz_ZipWriteFile._fileobj�s
���}��rc��dS)NTrr�s r�writablez_ZipWriteFile.writable�s���trc��|jrtd���t|ttf��rt|��}nt
|��}|j}|xj|z
c_t||j
��|_
|jr7|j�|��}|xj
t|��z
c_
|j�|��|Sr�)r�r�r�rrr6�
memoryview�nbytesr�r�r�r�rr�rvrn)r�rcr�s   rrnz_ZipWriteFile.write�s����;�	>��<�=�=�=��d�U�I�.�/�/�	!���Y�Y�F�F��d�#�#�D��[�F����6�!����$��	�*�*��	���	-��#�,�,�T�2�2�D����3�t�9�9�,����
���D�!�!�!��
rc	�L��|jrdS	t�����|jrb|j���}|xjt
|��z
c_|j�|��|j|j	_
n|j|j	_
|j|j	_
|j|j	_|js>|jt krt#d���|jt krt#d���|j	jt&zr�|jrdnd}|j�t)j|t,|j	j
|j	j
|j	j����|j���|j_n�|j���|j_|j�|j	j��|j�|j	�|j����|j�|jj��|jj�|j	��|j	|jj|j	j <d|j_!dS#d|j_!wxYw)Nz*File size too large, try using force_zip64z0Compressed size too large, try using force_zip64z<LLQQz<LLLLF)"r�r�rYr�r!r�r6rvrnr�r�r�r�r�r�r�r�r<r�r�rSr��
_DD_SIGNATURErtr��	start_dirrQr�r��filelistr7�
NameToInforNrU)r�r�r�r�s   �rrYz_ZipWriteFile.close�sE����;�	��F�(	+��G�G�M�M�O�O�O���
<��&�,�,�.�.���#�#�s�3�x�x�/�#�#��
�#�#�C�(�(�(�,0�,?���)�)�,0�O���)�"�i�D�K�O�$(�O�D�K�!��;�
[��?�[�0�0�&�'S�T�T�T��&��4�4�&�'Y�Z�Z�Z��{�$�'@�@�
<�!%��9�g�g�'���
�#�#�F�K��]�D�K�O��K�-�t�{�/D�%F�%F�G�G�G�*.�-�*<�*<�*>�*>��
�'�'�+/�-�*<�*<�*>�*>��
�'��
�"�"�4�;�#<�=�=�=��
�#�#�D�K�$:�$:�4�;�$G�$G�H�H�H��
�"�"�4�=�#:�;�;�;�
�M�"�)�)�$�+�6�6�6�=A�[�D�M�$�T�[�%9�:�%*�D�M�"�"�"��U�D�M�"�*�*�*�*s�I;J�J#)
rrrr��propertyrvr�rnrYr�r�s@rr�r�zs������������ � ��X� �������&++�++�++�++�++�++�++�++�++rr�c�*�eZdZ	dZdZdeddfddd�d�Zd�Zd�Zd�Z	d	�Z
d
�Zd�Zd$d�Z
d
�Zd�Zd�Zed���Zejd���Zd$d�Zd%dd�d�Zd&d�Zd'd�Zd(d�Zed���Zd�Zd�Z		d(d�Z	d'd�Zd)d�Zd �Z d!�Z!d"�Z"d#�Z#dS)*rN�rT)r��metadata_encodingc��	|dvrtd���t|��||_d|_d|_i|_g|_||_||_||_	d|_
d|_||_||_
|j
r|dkrtd���t|tj��rtj|��}t|t$��r[d|_||_dd	d
dd	dd
d�}||}			t+j||	��|_n#t0$r|	|vr
||	}	Y�5�wxYwn$d|_||_t3|dd��|_d|_t7j��|_d|_d|_	|dkr|� ��dS|dvr�d|_	|j�!��|_"	|j�#|j"��dS#tHt0f$rd|_YdSwxYw#tHt0f$r+tK|j��|_d|_"d|_YdSwxYw|dkr�	|� ��|j�#|j"��dS#tL$rD|j�#dd��d|_|j�!��|_"YdSwxYwtd���#|j}
d|_|�'|
���xYw)N)r��w�x�az+ZipFile requires mode 'r', 'w', 'x', or 'a'Frrr�z5metadata_encoding is only supported for reading filesrK�w+b�x+b�r+b�wb�xb)r�r�r�r�r�r�r�Tr!r�)r�r�r�r"z"Mode must be 'r', 'w', 'x', or 'a')(r�r@�_allowZip64�
_didModify�debugr�r�r?rGr�r�_comment�_strict_timestampsr�r�r�r�r��str�_filePassedrNr�rMrGrE�getattr�_fileRefCnt�	threading�RLockrTr�rU�_RealGetContentsrtr�rQr�rir�_fpclose)r�rWr�r?�
allowZip64rGr�r��modeDictr�rGs           rr�zZipFile.__init__�sv��	��+�+�+��J�K�K�K��;�'�'�'�%��������
������
�&���*�����	������
�"3���!2����!�	I�d�c�k�k��G�I�I�
I��d�B�K�(�(�	#��9�T�?�?�D��d�C� � �	8� �D�� �D�M�"��U�%�$�T�$�@�@�H���~�H�
�� �g�d�H�5�5�D�G�G�������8�+�+�#+�H�#5�� ���	����
� �D���D�G�#�D�&�$�7�7�D�M�����_�&�&��
������
�'	��s�{�{��%�%�'�'�'�'�'���#�#�#'���/�%)�W�\�\�^�^�D�N�/�����T�^�4�4�4�4�4��*�G�4�/�/�/�).������/�����'��0�+�+�+�'���0�0�D�G�%&�D�N�%*�D�N�N�N�N�+��������4��)�)�+�+�+��G�L�L���0�0�0�0�0��!�4�4�4��G�L�L��A�&�&�&�'+�D�O�%)�W�\�\�^�^�D�N�N�N�N�4����!�!E�F�F�F��	���B��D�G��M�M�"�������s�9D�D.�,D.�K&� K&�,H�G,�,H�K&�H�K&�8I�K&�I�	K&�3J�A
K�K&�K�K&�&&Lc��|Sr�rr�s r�	__enter__zZipFile.__enter__Hs���rc�.�|���dSr��rY)r��type�value�	tracebacks    r�__exit__zZipFile.__exit__Ks���
�
�����rc��d|jj�d|jj��g}|j�g|jr|�d|jz��n$|j�|�d|jz��|�d|jz��n|�d��|�d��d�|��S)	Nr�r�z file=%rz filename=%rz mode=%rr�r�r�)	r�rrrGr�r7rNr�r8r�s  rr�zZipFile.__repr__Ns����"�n�7�7�7�"�n�9�9�;�<���7����
>��
�
�j�4�7�2�3�3�3�3���*��
�
�n�t�}�<�=�=�=��M�M�*�t�y�0�1�1�1�1��M�M�+�&�&�&��
�
�c�����w�w�v���rc��	|j}	t|��}n#t$rtd���wxYw|std���|jdkrt|��|t}|t}|t|_	|t|z
|z
}|ttkr|ttzz}|jdkr||z}td|||��||z|_|jdkrtd���|�|jd��|�|��}t%j|��}d}||k�r�|�t(��}	t+|	��t(krtd���t-jt0|	��}	|	t2t4krtd���|jdkrt|	��|�|	t6��}
|	t8}|t:zr|
�d	��}
n|
�|jpd
��}
tA|
��}|�|	tB��|_"|�|	tF��|_$|	tJ|_&|	dd�\|_'|_(|_)|_*|_+|_,}
}|_-|_.|_/|j)t`krtcd|j)d
zz���|	dd�\|_2|_3|_4|
|_5|dz	dz|dz	dz|dz|
dz	|
dz	dz|
dzdzf|_6|�7��|j&|z|_&|j8�9|��||j:|j;<|t(z|	t6z|	tBz|	tFz}|jdkrtd|��||k���|j}ty|j8d�d���D]}||_=|j&}�dS)NzFile is not a zip filer!r"zgiven, inferred, offsetrz Bad offset for central directoryzTruncated central directoryz&Bad magic number for central directoryr��cp437rzzip file version %.1fr)r,r/r(r�r%r�r*r �totalc��|jSr�)r�)r�s r�<lambda>z*ZipFile._RealGetContents.<locals>.<lambda>�s	��e�.A�rT)�key�reverse)>rGrDrErr��printr^r_�_ECD_COMMENTr��
_ECD_LOCATIONrYrXrVrRr�rQrJr��BytesIO�sizeCentralDirr6rSr5�structCentralDir�
_CD_SIGNATURE�stringCentralDir�_CD_FILENAME_LENGTH�
_CD_FLAG_BITSr��decoder�r�_CD_EXTRA_FIELD_LENGTHr9�_CD_COMMENT_LENGTHr��_CD_LOCAL_HEADER_OFFSETr�rir�r�r�r�r�r�r�r��MAX_EXTRACT_VERSIONr>r�r�r�r�r�r�r�r7r�rN�sortedr�)r�rGrb�size_cd�	offset_cd�concat�inferredrcr�centdirrN�flagsr��t�d�
end_offsetr�s                 rr�zZipFile._RealGetContents\sO��=�
�W��	7� ��_�_�F�F���	7�	7�	7��5�6�6�6�	7�����	7��5�6�6�6��:��>�>��&�M�M�M���#���;�'�	��|�,��
��
�&��0�9�<���.�!�%7�7�7��'�*A�A�B�F��:��>�>��	�)�H��+�Y��&�I�I�I�"�V�+����>�A����?�@�@�@�
������"�"�"��w�w�w����
�Z��
�
�����g�o�o��g�g�n�-�-�G��7�|�|�~�-�-� �!>�?�?�?��m�$4�g�>�>�G��}�%�)9�9�9� �!I�J�J�J��z�A�~�~��g�����w�w�w�':�;�<�<�H��M�*�E��)�)�
N�#�?�?�7�3�3���$�?�?�4�+A�+L�W�M�M����!�!�A��g�g�g�&<�=�>�>�A�G�����(:� ;�<�<�A�I�%�&=�>�A�O�5<�A�b�D�M�
2�Q�
�q���0A�1�:�
�[�!�/�1�a�
�U�A�O�Q�[�� �#6�6�6�)�*A�+,�+<�r�+A�+C�D�D�D�9@��B���6�A�H�a�o�q���A�K���T�4�K�!�Q�$���Q�t�V��r�E�A�q�D�$�;��4��1��?�A�K�
�N�N�����o��6�A�O��M� � ��#�#�#�*+�D�O�A�J�'��^�+�g�6I�.J�J��5�6�7��1�2�3�E��z�A�~�~��g�u�%�%�%�[�g�o�o�^�^�
��D�M� A� A�$(�*�*�*�	-�	-�E�!+�E���,�J�J�		-�	-s��4c�&�	d�|jD��S)Nc��g|]	}|j��
Sr�rN)�.0rcs  r�
<listcomp>z$ZipFile.namelist.<locals>.<listcomp>�s��8�8�8�$��
�8�8�8r�r�r�s r�namelistzZipFile.namelist�s��9�8�8�$�-�8�8�8�8rc��	|jSr�r)r�s r�infolistzZipFile.infolist�s��	��}�rc��	tddz|���|jD]5}d|jdd�z}td|j||jfz|����6dS)Nz%-46s %19s %12s)z	File NamezModified    �Size�rWz%d-%02d-%02d %02d:%02d:%02dr&z
%-46s %s %12d)rr�r�rNr�)r�rWr��dates    r�printdirzZipFile.printdir�s���9�
��"G�G��	�	�	�	��]�	�	�E�0�5�?�2�A�2�3F�F�D��/�U�^�T�5�?�$K�K��
�
�
�
�
�	�	rc��	d}|jD]z}	|�|jd��5}|�|��r	|�|���ddd��n#1swxYwY�b#t$r|jcYcSwxYwdS)Nir�)r�rMrNrJr)r��
chunk_sizer��fs    r�testzipzZipFile.testzip�s���3��
��]�	&�	&�E�
&��Y�Y�u�~�s�3�3��q��&�&��,�,����&�&��,�,�����������������������
&�
&�
&��~�%�%�%�%�%�
&����	&�	&s4�A-�,A!�A-�!A%	�%A-�(A%	�)A-�-B�Bc�d�	|j�|��}|�td|z���|S)Nz(There is no item named %r in the archive)r�r��KeyError)r�r��infos   r�getinfozZipFile.getinfo�sC��:���"�"�4�(�(���<��:�T�A�C�C�
C��rc��	|r9t|t��s$tdt|��jz���|r	||_dSd|_dS)N�pwd: expected bytes, got %s)r�r�	TypeErrorr�rr)r�rs  r�setpasswordzZipFile.setpassword�s[��7��	P�z�#�u�-�-�	P��9�D��I�I�<N�N�O�O�O��	��D�H�H�H��D�H�H�Hrc��	|jSr�)r�r�s rr�zZipFile.comment�s
��<��}�rc�(�t|t��s$tdt|��jz���t|��tkr2ddl}|�dtzd���|dt�}||_	d|_
dS)Nzcomment: expected bytes, got %srz3Archive comment is too long; truncating to %d bytesr"��
stacklevelT)r�rr<r�rr6�ZIP_MAX_COMMENT�warnings�warnr�r�)r�r�rCs   rr�zZipFile.comment�s����'�5�)�)�	X��=��W�
�
�@V�V�W�W�W��w�<�<�/�)�)��O�O�O��M�M�O�+�,�89�
�
;�
;�
;��.��.�/�G���
�����rc��	|�|d|��5}|���cddd��S#1swxYwYdS�Nr��rMrJ)r�r�rrGs    rrJzZipFile.read�s���)�
�Y�Y�t�S�#�
&�
&�	�"��7�7�9�9�	�	�	�	�	�	�	�	�	�	�	�	����	�	�	�	�	�	s
�:�>�>F��force_zip64c���	|dvrtd���|r|dkrtd����jstd���t|t��r|}nC|dkr(t|��}�j|_�j|_n��|��}|dkr��	||���S�j
rtd����xjdz
c_t�j|j
�j�j�fd	���}	|�t"��}t%|��t"krt'd
���t)jt,|��}|t.t0krt'd���|�|t2��}|t4r |�|t4��|jt8zrt;d���|jt<zrt;d
���|t>t@zr|�!d��}	n|�!�j"pd��}	|	|j#krt'd|j#�d|�d����|j$�=|�%��|j&z|j$krt'd|j#�d����|jtNz}
|
rY|s�j(}|r9t|tR��s$tUdtW|��j,z���|st[d|z���nd}t]||||d��S#|�/���xYw)N>r�r�zopen() requires mode "r" or "w"r�z'pwd is only supported for reading filesz2Attempt to use ZIP archive that was already closedrHrar!c����jSr�)rUr�s�rrzZipFile.open.<locals>.<lambda>)s	���$�-�rzTruncated file headerz Bad magic number for file headerz$compressed patched data (flag bit 5)zstrong encryption (flag bit 6)r�rzFile name in directory z and header z differ.zOverlapped entries: z (possible zip bomb)r;z6File %r is encrypted, password required for extractionT)0r�rGr�rr?r�rGr�r9�_open_to_writerUr�rOr�r�rTrJ�sizeFileHeaderr6rrSr5r��
_FH_SIGNATUREr��_FH_FILENAME_LENGTH�_FH_EXTRA_FIELD_LENGTHr��_MASK_COMPRESSED_PATCHr>�_MASK_STRONG_ENCRYPTION�_FH_GENERAL_PURPOSE_FLAG_BITSr�rr�r�r�rtr��_MASK_ENCRYPTEDrrr<r�rr<rtrY)r�r�r�rrIr��zef_file�fheader�fname�	fname_str�is_encrypteds`          rrMzZipFile.open�s����	��z�!�!��>�?�?�?��	H�D�C�K�K��F�G�G�G��w�	F��D�F�F�
F��d�G�$�$�		'��E�E�
�S�[�[��D�M�M�E�"&�"2�E��#'�#5�E� � ��L�L��&�&�E��3�;�;��&�&�u�+�&�F�F�F��=�	G��F�G�G�
G�
	
���A�����t�w��(;�#�}�d�j�:O�:O�:O�:O�Q�Q��4	��m�m�N�3�3�G��7�|�|�~�-�-� �!8�9�9�9��m�$4�g�>�>�G��}�%�)9�9�9� �!C�D�D�D��M�M�'�*=�">�?�?�E��-�.�
?��
�
�g�&<�=�>�>�>���!7�7�
R�)�*P�Q�Q�Q���!8�8�
L�)�*J�K�K�K��4�5�8J�J�
L�!�L�L��1�1�	�	�!�L�L��)?�)J�7�K�K�	��E�/�/�/� �j��*�*�*�E�E�E�3�4�4�4��!�-��
�
���%�"5�5��8I�I�I� �!c��8K�!c�!c�!c�d�d�d�!�?�_�<�L��	
��#��(�C��X�z�#�u�5�5�X�#�$A�D��I�I�DV�$V�W�W�W��I�&�(A�CG�(H�I�I�I�I����h��e�S�$�?�?�?��	��N�N�������s
�H8M�Mc���|r|jstd���|jrtd���d|_d|_d|_|jtkr|xjtzc_|j	s|xjtzc_|jsd|_|p|jdztk}|js|rtd���|j	r|j�|j��|j���|_|�|��d|_|j�|�|����d|_t1|||��S)NzHforce_zip64 is True, but allowZip64 was False when opening the ZIP file.zzCan't write to the ZIP file while there is another write handle open on it. Close the first handle before opening another.r��g�������?z'Filesize would require ZIP64 extensionsT)r�r�rUr�r�r�r�r	�_MASK_COMPRESS_OPTION_1r�r�r�r�r�rrGrQr�rtr��_writecheckr�rnr�r�)r�r�rIr�s    rrLzZipFile._open_to_write`s{���	�t�/�	�� ���
��=�	O��N�O�O�
O�
 �����	������(�*�*��O�O�6�6�O�O��~�	9��O�O�8�8�O�O��"�	.�"-�E���E���$� 6�� D����	J�E�	J��H�I�I�I��>�	)��G�L�L���(�(�(�"�g�l�l�n�n���������������
�
�e�&�&�u�-�-�.�.�.���
��T�5�%�0�0�0rc��	|�tj��}ntj|��}|�|||��Sr�)r��getcwdr��_extract_member)r��memberr�rs    r�extractzZipFile.extract�s@��	�
�<��9�;�;�D�D��9�T�?�?�D��#�#�F�D�#�6�6�6rc��	|�|���}|�tj��}ntj|��}|D]}|�|||���dSr�)r*r�r_r�r`)r�r��membersrr�s     r�
extractallzZipFile.extractall�sn��	�
�?��m�m�o�o�G��<��9�;�;�D�D��9�T�?�?�D��	5�	5�G�� � ��$��4�4�4�4�	5�	5rc�(�	|j}|s4d}t�|dt|��z��}||_|�|��}d�|�|��D��}|�d�|D����}|S)Nz:<>|"?*�_c3�@K�|]}|�d��V��dS)r�N)�rstrip�r'r�s  r�	<genexpr>z1ZipFile._sanitize_windows_name.<locals>.<genexpr>�s,����A�A�Q�1�8�8�C�=�=�A�A�A�A�A�Arc3�K�|]}|�|V��	dSr�rrjs  rrkz1ZipFile._sanitize_windows_name.<locals>.<genexpr>�s'����7�7�Q�Q�7�q�7�7�7�7�7�7r)�!_windows_illegal_name_trans_tabler��	maketransr6�	translate�splitr8)r�r��pathsep�table�illegals     r�_sanitize_windows_namezZipFile._sanitize_windows_name�s���I��5���	:��G��M�M�'�3��W���+=�>�>�E�49�C�1��#�#�E�*�*��A�A�'�-�-��*@�*@�A�A�A���,�,�7�7�'�7�7�7�7�7���rc�t��	t|t��s|�|��}|j�dt
jj��}t
jjr4|�t
jjt
jj��}t
j�	|��d}dt
jj
t
jjf�t
jj��fd�|�
t
jj��D����}t
jjdkr%|�|t
jj��}t
j�||��}t
j�|��}t
j�|��}|r3t
j�|��stj|��|���r5t
j�|��stj|��|S|�||���5}t-|d��5}t/j||��ddd��n#1swxYwYddd��n#1swxYwY|S)Nr�r!r�c3�$�K�|]
}|�v�|V��dSr�r)r'r��invalid_path_partss  �rrkz*ZipFile._extract_member.<locals>.<genexpr>�s>�����#C�#C��&'�/A�&A�&A�$%�&A�&A�&A�&A�#C�#Cr�\�rr�)r�rr9rNr�r�r�r�r�r��curdir�pardirr8rprtr��dirname�exists�makedirsr�r��mkdirrM�shutil�copyfileobj)	r�ra�
targetpathrr��	upperdirs�source�targetrws	        @rr`zZipFile._extract_member�s����	��&�'�*�*�	*��\�\�&�)�)�F��/�)�)�#�r�w�{�;�;��
�7�>�	C��o�o�b�g�n�b�g�k�B�B�G��'�$�$�W�-�-�a�0�� �"�'�.�"�'�.�A���'�+�"�"�#C�#C�#C�#C�g�m�m�B�G�K�.H�.H�#C�#C�#C�C�C��
�7�;�$����1�1�'�2�7�;�G�G�G��W�\�\�*�g�6�6�
��W�%�%�j�1�1�
��G�O�O�J�/�/�	��	#�R�W�^�^�I�6�6�	#��K�	�"�"�"��=�=�?�?�	��7�=�=��,�,�
%����$�$�$���
�Y�Y�v�3�Y�
'�
'�	/�6�
�*�d�
#�
#�	/�'-���v�v�.�.�.�	/�	/�	/�	/�	/�	/�	/�	/�	/�	/�	/����	/�	/�	/�	/�	/�	/�	/�	/�	/�	/�	/�	/�	/�	/�	/����	/�	/�	/�	/��s6�#J-�4J�
J-�J	�J-�J	�J-�-J1�4J1c��	|j|jvr#ddl}|�d|jzd���|jdvrtd���|jstd���t|j��|j	s[d}t|j��tkrd}n%|j
tkrd	}n|jtkrd
}|rt!|dz���dSdS)NrzDuplicate name: %rr#r@�r�r�r�z&write() requires mode 'w', 'x', or 'a'z4Attempt to write ZIP archive that was already closed�Files count�FilesizezZipfile size� would require ZIP64 extensions)rNr�rCrDr�r�rGr@r�r�r6r��ZIP_FILECOUNT_LIMITr�r�r�r)r�r�rC�requires_zip64s    rr]zZipFile._writecheck�s!��D��>�T�_�,�,��O�O�O��M�M�.���?�A�M�N�N�N��9�O�+�+��E�F�F�F��w�	H��F�H�H�
H��5�.�/�/�/���
	F�!�N��4�=�!�!�%8�8�8�!.�����;�.�.�!+����$�{�2�2�!/���
F�"�>�#D�$E�F�F�F�
	F�
	F�
F�
Frc�H�	|jstd���|jrtd���t�|||j���}|���r%d|_d|_|�	|��dS|�||_
n|j|_
|�||_n|j
|_t|d��5}|�|d��5}tj||d��ddd��n#1swxYwYddd��dS#1swxYwYdS)N�7Attempt to write to ZIP archive that was already closedz>Can't write to ZIP archive while an open writing handle existsr�rrKr�i )rGr�rUrr�r�r�r�r�rr�r?r�rGrMr�r�)r�rNr�r�rGr��src�dests        rrnz
ZipFile.write�s���	��w�	K��I�K�K�
K��=�	��P���
��!�!�(�G�48�4K�"�M�M���<�<�>�>�	6�"#�E���E�I��J�J�u�������(�&3��#�#�&*�&6��#��(�'4��$�$�'+�'9��$��h��%�%�
6��d�i�i��s�.C�.C�
6�t��"�3��f�5�5�5�
6�
6�
6�
6�
6�
6�
6�
6�
6�
6�
6����
6�
6�
6�
6�
6�
6�
6�
6�
6�
6�
6�
6�
6�
6�
6�
6����
6�
6�
6�
6�
6�
6s6�D�C?�3D�?D	�D�D	�D�D�Dc��	t|t��r|�d��}t|t��s�t|t	jt	j����dd����}|j|_|j|_	|j
ddkrd|_|xjdzc_n
d|_n|}|jstd	���|jrtd
���|�||_|�||_	t|��|_|j5|�|d���5}|�|��ddd��n#1swxYwYddd��dS#1swxYwYdS)
Nr�r&)rNr�r_r�i�Ar-r[r�z?Can't write to ZIP archive while an open writing handle exists.r�)r�)r�r�r�rr�r�r?r�rGr�rNr�rGr�rUr6r�rTrMrn)r��zinfo_or_arcnamercr�rGr�r�s       r�writestrzZipFile.writestrs��	0�
�d�C� � �	(��;�;�w�'�'�D��*�G�4�4�	%��%5�&*�n�T�Y�[�[�&A�&A�"�1�"�&E�G�G�G�E�"&�"2�E��#'�#5�E� ��~�b�!�S�(�(�&3��#��#�#�t�+�#�#�#�&1��#�#�$�E��w�	K��I�K�K�
K��=�	��Q���
��$�"/�E���$�#0�E� ��d�)�)���
�Z�	!�	!����5�s��+�+�
!�t��
�
�4� � � �
!�
!�
!�
!�
!�
!�
!�
!�
!�
!�
!����
!�
!�
!�
!�	!�	!�	!�	!�	!�	!�	!�	!�	!�	!�	!�	!����	!�	!�	!�	!�	!�	!s6�!E3�9E�E3�E	�E3�"E	�#E3�3E7�:E7�c��	t|t��r&|}|���std���n�t|t��ra|}|�d��s|dz
}t|��}d|_d|_d|zdzdz|_d|_	|xjdzc_ntd���|j5|jr|j
�|j��|j
���|_|jt&kr|xjt*zc_|�|��d|_|j�|��||j|j<|j
�|�d	����|j
���|_ddd��dS#1swxYwYdS)
Nz/The given ZipInfo does not describe a directoryr�ri@rr-zExpected type str or ZipInfoTF)r�rr�r�r�r�r�r�r�r�r<rTr�rGrQr�rtr�r�r	r�r\r]r�r�r7r�rNrnr�)r��zinfo_or_directory_namer�r��directory_names     rrz
ZipFile.mkdirBs	��9��-�w�7�7�	<�+�E��<�<�>�>�
T� �!R�S�S�S�
T�
�/��
5�
5�	<�4�N�!�*�*�3�/�/�
&��#�%���N�+�+�E�"#�E���E�I�$+�d�N�f�#<��"C�E���E�O����4�'�����:�;�;�;�
�Z�	,�	,��~�
-�����T�^�,�,�,�"&�'�,�,�.�.�E���"�h�.�.����#:�:������U�#�#�#�"�D�O��M� � ��'�'�'�.3�D�O�E�N�+��G�M�M�%�*�*�5�1�1�2�2�2�!�W�\�\�^�^�D�N�	,�	,�	,�	,�	,�	,�	,�	,�	,�	,�	,�	,����	,�	,�	,�	,�	,�	,s�	C:G�G�Gc�0�	|���dSr�r�r�s r�__del__zZipFile.__del__es��@��
�
�����rc��	|j�dS|jrtd���	|jdvr`|jrY|j5|jr|j�|j��|�	��ddd��n#1swxYwY|j}d|_|�
|��dS#|j}d|_|�
|��wxYw)NzvCan't close the ZIP file while there is an open writing handle on it. Close the writing handle before closing the zip.r�)rGrUr�r�r�rTr�rQr��_write_end_recordr�rls  rrYz
ZipFile.closeis2��	��7�?��F��=�	Q��P�Q�Q�
Q�		��y�O�+�+���+��Z�-�-��~�5�����T�^�4�4�4��*�*�,�,�,�-�-�-�-�-�-�-�-�-�-�-����-�-�-�-�
��B��D�G��M�M�"���������B��D�G��M�M�"�������s.�B0�;B�4B0�B�B0�B�B0�0%Cc�R	�|jD�]�}|j}|ddz
dz|ddzz|dz}|ddz|d	dzz|ddzz}g}|jtks|jtkr9|�|j��|�|j��d
}d
}n|j}|j}|jtkr|�|j��d
}n|j}|j}	d}
|rQt|	d��}	tj
dd
t|��zzddt|��zg|�R�|	z}	t}
|j
tkrtt |
��}
n%|j
t"krtt$|
��}
t|
|j��}t|
|j��}|���\}
}tj
t,t.||j||j||j
|||j||t|
��t|	��t|j��d|j|j|��}|j�|��|j�|
��|j�|	��|j�|j�����|j� ��}t|j��}||j!z
}|j!}d}|tDkrd}n|tkrd}n
|tkrd}|r�|j#stI|dz���tj
tJtLddddd||||��}|j�|��tj
tNtPd|d��}|j�|��tS|d��}tS|d
��}tS|d
��}tj
tTtVdd||||t|j,���	�	}|j�|��|j�|j,��|j-dkr|j�.��|j�/��dS)Nrr�r(r!r%r"r#r*r$r�r�r2�Qrr�zCentral directory offsetzCentral directory sizer��,rrr�)0r�r�r�r�r�r7r�r9rBrSr�r6r�r�rryr�r	r�r�rir�rrr�r�r�r�r�r�rGrnrtr�r�r�rrWrXrTrUr�rwrvr�r��truncater!)r�r�r�r�r�r9r�r�r��
extra_datar�r�rirNr�r�pos2�centDirCount�centDirSize�
centDirOffsetr��zip64endrec�zip64locrecrbs                        rr�zZipFile._write_end_recordsw���]�3	)�3	)�E���B��!�u�t�|��)�B�q�E�Q�J�6��A��>�G���e�r�k�B�q�E�Q�J�.�"�Q�%�1�*�=�G��E����,�,��%��3�3����U�_�-�-�-����U�0�1�1�1�&�	� *�
�
�!�O�	� %� 3�
��"�[�0�0����U�0�1�1�1� *�
�
� %� 3�
���J��K��
,�)�*�d�;�;�
�#�[��C��E�
�
�N�*��q��U���|�-�&+�-�-�-�/9�:�
�,���"�i�/�/�!�-��=�=����$��0�0�!�,��<�<��!�+�u�/D�E�E�O� ��e�.B�C�C�N�"'�"<�"<�">�">��H�i��k�"2�"2�N�"'�"5����"+�U�-@�'�7�"'�)�]�I�"%�h�-�-��Z���#�e�m�BT�BT�"#�U�%8�%�:M�"/�1�1�G�
�G�M�M�'�"�"�"��G�M�M�(�#�#�#��G�M�M�*�%�%�%��G�M�M�%�-�(�(�(�(��w�|�|�~�~���4�=�)�)���T�^�+����
����-�-�-�*�N�N�
�[�
(�
(�7�N�N�
�;�
&�
&�5�N��	;��#�
F�"�>�#D�$E�F�F�F� �+�"�$6��B��A�q�,���]�,�,�K�
�G�M�M�+�&�&�&� �+�)�)�1�d�A�7�7�K�
�G�M�M�+�&�&�&��|�V�4�4�L��k�:�6�6�K��
�z�:�:�M���-�/?���<��(�-��T�]�9K�9K�M�M��	
��
�
�f������
�
�d�m�$�$�$��9�����G��������
�
�����rc�r�|xjdzc_|js|js|���dSdSdS�Nr!)r�r�rYrls  rr�zZipFile._fpclose�sP�����A������	��(8�	��H�H�J�J�J�J�J�	�	�	�	rr�)r�N)F)NN)NNN)r�)$rrrrGrmrr�r�rr�r�r*r,r1r5r9r=r�r��setterrJrMrLrbrer�rtr`r]rnr�rr�rYr�r�rrrrr�ss�������,
�B�(,�%�"%�:�$�#�^�:>�RV�^�^�^�^�^�@���������T-�T-�T-�l9�9�9����
����&�&�&�����������X��
�^�
�
��^�
�����
d�E�d�d�d�d�d�L(1�(1�(1�(1�T7�7�7�7�5�5�5�5�"����[��(�(�(�TF�F�F�.'+�04�6�6�6�6�D48�'!�'!�'!�'!�R!,�!,�!,�!,�F������,\�\�\�|����rrc�.�eZdZ	deddfd�Zd	d�Zd�ZdS)
r
r�Tr_c�R�t�|||||���||_dS)N)r�r?r�)rr��	_optimize)r�rWr�r?r��optimizes      rr�zPyZipFile.__init__�s5������t�$�K�$.�	�	0�	0�	0�!����rr�Nc�b�	tj|��}|rL||��sA|jr8tj�|��rdnd}t|�d|�d���dStj�|��\}}tj�|���rtj�|d��}tj�|���r�|r|�d|��}n|}|jrtd|d|��|�	|d	d
�|��\}}	|jrtd|	��|�
||	��ttj|����}
|
�
d��|
D�]5}tj�||��}tj�|��\}
}tj�|��rVtj�tj�|d����r|�|||�����|d
kru|r%||��s|jrtd|z����|�	|d	d
�|��\}}	|jrtd|	��|�
||	����7dS|jrtd|��ttj|����D]�}tj�||��}tj�|��\}
}|d
kru|r%||��s|jrtd|z���q|�	|d	d
�|��\}}	|jrtd|	��|�
||	����dS|d
d�d
krt!d���|�	|d	d
�|��\}}	|jrtd|	��|�
||	��dS)Nr�rW� z skipped by filterfuncz__init__.pyr�zAdding package in�asr����Adding)�
filterfunc�.pyzfile %r skipped by filterfunczAdding files from directoryz.Files added with writepy() must end with ".py"zAdding file)r�r�r�r�r�rrpr8�isfile�
_get_codenamernr�listdir�remove�splitext�writepyr<)r��pathname�basenamer��label�dirr��initnamerWr��dirlistrNr��root�exts               rr�zPyZipFile.writepy�s`��	��9�X�&�&���	�j�j��2�2�	��z�
I�"$�'�-�-��"9�"9�E���v���u�u�u�h�h�h�G�H�H�H��F��G�M�M�(�+�+�	��T�
�7�=�=��"�"�;	'��w�|�|�H�m�<�<�H��w�~�~�h�'�'�1
3��$�*2�(�(�D�D�9�H�H�#�H��:�I��-�x��x�H�H�H�!%�!3�!3�H�Q�r�T�N�H�!M�!M���w��:�-��(�G�,�,�,��
�
�5�'�*�*�*� ���H�!5�!5�6�6�����}�-�-�-� '�3�3�H��7�<�<��(�;�;�D� "�� 0� 0�� :� :�I�D�#��w�}�}�T�*�*�3��7�>�>�"�'�,�,�t�]�*K�*K�L�L�@� �L�L��x�4>�)�@�@�@������%�%�j�j��.>�.>�%�#�z�N� %�&E��&L� M� M� M�$�)-�);�);�D��2��J�<D�*F�*F���w��:�5�!�(�G�4�4�4��
�
�5�'�2�2�2��#3�3�(�:�C��7��B�B�B� &�r�z�(�';�';� <� <�3�3�H��7�<�<��(�;�;�D� "�� 0� 0�� :� :�I�D�#��e�|�|�%�%�j�j��.>�.>�%�#�z�N� %�&E��&L� M� M� M�$�)-�);�);�D��2��J�<D�*F�*F���w��:�5�!�(�G�4�4�4��
�
�5�'�2�2�2��3�3�����}��%�%�"�D�F�F�F�!�/�/���2����I�I�N�E�7��z�
.��m�W�-�-�-��J�J�u�g�&�&�&�&�&rc�:��	d
�fd�	}|dz}|dz}tj�|d���}tj�|d���}tj�|d���}�jdk�r�tj�|��r:t	j|��jt	j|��jkr|x}	}
�ntj�|��r:t	j|��jt	j|��jkr|}
|}	�n�tj�|��r:t	j|��jt	j|��jkr|}
|}	�n^tj�|��r:t	j|��jt	j|��jkr|}
|}	�n||��r5tj
jd	kr|}
ntj
jdkr|}
n|}
|}	n�|x}
}	n��jd	kr|}
|}	nG|}	�jdkr|}
n7�jdkr|}
n)d
��j��}t|���tj�|
��r4t	j|
��jt	j|��jks||�j���s|x}
}	tj�|	��d}|r|�d|��}|
|fS)Nr_c����ddl}�jrtd|��	|�|d|���n,#|j$r}t|j��Yd}~dSd}~wwxYwdS)Nr�	CompilingT)�doraiser�F)�
py_compiler�r�compile�PyCompileError�msg)rWr�r��errr�s    �r�_compilez)PyZipFile._get_codename.<locals>._compileFs���������z�
)��k�4�(�(�(�
��"�"�4���"�I�I�I�I���,�
�
�
��c�g�����u�u�u�u�u�����
�����4s�7�
A �A�A r�z.pycr�)�optimizationr!r"rz"invalid value for 'optimize': {!r})r�r�rg)�	importlib�util�cache_from_sourcer�r�r�r�r�r�r�r r��formatr�rp)
r�r�r�r��file_py�file_pyc�pycache_opt0�pycache_opt1�pycache_opt2r�rWr��archivenames
`            rr�zPyZipFile._get_codename?s���	�		�		�		�		�		�		��e�#���f�$�� �~�7�7��b�7�Q�Q�� �~�7�7��a�7�P�P�� �~�7�7��a�7�P�P���>�R�������x�(�(�!
.��'�(�#�#�,����0@�0@�0I�I�I�"*�*��%�%��'�.�.��.�.�
.��'�,�'�'�0�B�G�G�4D�4D�4M�M�M�%��"����'�.�.��.�.�
.��'�,�'�'�0�B�G�G�4D�4D�4M�M�M�%��"����'�.�.��.�.�
.��'�,�'�'�0�B�G�G�4D�4D�4M�M�M�%��"����8�G�$�$�	.��y�)�Q�.�.� ,�����+�q�0�0� ,��� ,��&�G�G�&-�-�E�G�G��~��"�"�$��"���"���>�Q�&�&�(�E�E��^�q�(�(�(�E�E�>�E�E�d�n�U�U�C�$�S�/�/�)��G�N�N�5�)�)�
.��G�E�N�N�+�r�w�w�/?�/?�/H�H�H��x��$�.�A�A�A�.�&-�-�E�G��g�m�m�G�,�,�Q�/���	<�%-�X�X�{�{�;�K��{�#�#r)r�N)rrrrr�r�r�rrrr
r
�sb������N�"%�:� �2�"�"�"�"�P'�P'�P'�P'�dP$�P$�P$�P$�P$rr
c�J�	tjt|��dd��Sr�)�	itertools�islice�	_ancestry)r�s r�_parentsr��s$�����I�d�O�O�Q��5�5�5rc#�K�	|�tj��}|�tj��r<|V�tj|��\}}|�tj���:dSdSr�)ri�	posixpathr�rp)r��tails  rr�r��s~�����(�;�;�y�}�%�%�D�
�+�+�i�m�
$�
$�+��
�
�
��_�T�*�*�
��d��+�+�i�m�
$�
$�+�+�+�+�+rc�R�	tjt|��j|��Sr�)r��filterfalse�set�__contains__)�minuend�
subtrahends  r�_differencer��s%���� ��Z���!=�w�G�G�Grc�b��eZdZ	ed���Z�fd�Zd�Zd�Z�fd�Ze	d���Z
�xZS)�CompleteDirsc��tj�tt|����}d�|D��}tt
||����S)Nc3�4K�|]}|tjzV��dSr�)r�r�)r'r
s  rrkz-CompleteDirs._implied_dirs.<locals>.<genexpr>�s)����6�6��1�y�}�$�6�6�6�6�6�6r)r��chain�
from_iterablerr��_deduper�)�names�parents�as_dirss   r�
_implied_dirszCompleteDirs._implied_dirs�sL���/�/�/��H�e�0D�0D�E�E��6�6�g�6�6�6���{�7�E�2�2�3�3�3rc���tt|�����}|t|�|����zSr�)r�r�r*rxr�)r�r�r�s  �rr*zCompleteDirs.namelist�s?����l�D�)�)�2�2�4�4���t�D�.�.�u�5�5�6�6�6�6rc�D�t|�����Sr�)r�r*r�s r�	_name_setzCompleteDirs._name_set�s���4�=�=�?�?�#�#�#rc�R�	|���}|dz}||vo||v}|r|n|S�Nr�)r�)r�r�r�r|�	dir_matchs     r�resolve_dirzCompleteDirs.resolve_dir�sD��	���� � ����*����%�:�'�U�*:�	�#�-�w�w��-rc����		t���|��S#t$r?|�d��r||���vr�t|���cYSwxYw)Nr�r&)r�r9r7r�r�r)r�r�r�s  �rr9zCompleteDirs.getinfo�s����	�	*��7�7�?�?�4�(�(�(���	*�	*�	*��=�=��%�%�
��T�^�^�5E�5E�)E�)E���D�)�)�)�)�)�)�	*���s� %�AA.�-A.c��	t|t��r|St|t��s||��Sd|jvrt}||_|SrF)r�r�rr�r�)r�r�s  r�makezCompleteDirs.make�sa��	��f�l�+�+�	��M��&�'�*�*�	��3�v�;�;���f�k�!�!��C�����
r)rrr�staticmethodr�r*r�r�r9r�r�r�r�s@rr�r��s���������
�4�4��\�4�
7�7�7�7�7�$�$�$�.�.�.�	*�	*�	*�	*�	*�����[�����rr�c�*��eZdZ	�fd�Z�fd�Z�xZS)�
FastLookupc����tjt��5|jcddd��S#1swxYwYt	t
|�����|_|jSr�)�
contextlib�suppressr��_FastLookup__namesr�r�r*r�s �rr*zFastLookup.namelist	s����
�
 ��
0�
0�	 �	 ��<�	 �	 �	 �	 �	 �	 �	 �	 �	 �	 �	 �	 ����	 �	 �	 �	 ��Z��.�.�7�7�9�9����|���/�3�3c����tjt��5|jcddd��S#1swxYwYt	t
|�����|_|jSr�)rrr��_FastLookup__lookupr�r�r�r�s �rr�zFastLookup._name_set	s����
�
 ��
0�
0�	!�	!��=�	!�	!�	!�	!�	!�	!�	!�	!�	!�	!�	!�	!����	!�	!�	!�	!��j�$�/�/�9�9�;�;��
��}�r)rrrr*r�r�r�s@rr�r�	sV��������
�������������rr�c�2�tj|d��||fS)Nr#)r��
text_encoding)�encoding�args�kwargss   r�_extract_text_encodingr	s��
��H�a�(�(�$��6�6rc��eZdZ	dZdd�Zddd�d�Zd�Zed	���Zed
���Z	ed���Z
ed���Zed
���Zd�Z
d�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�ZeZed���ZdS)rz>{self.__class__.__name__}({self.root.filename!r}, {self.at!r})r�c�T�	t�|��|_||_dSr�)r�r�r��at)r�r�rs   rr�z
Path.__init__p	s'��	��O�O�D�)�)��	�����rr�Nryc�n�	|���rt|���|d}|���s|dkrt|���|j�|j||���}d|vr|s|rtd���|St|i|��\}}}tj
||g|�Ri|��S)Nrr�ry�bz*encoding args invalid for binary operation)r��IsADirectoryErrorr}�FileNotFoundErrorr�rMrr�rr��
TextIOWrapper)r�r�rr	r
�zip_mode�streamrs        rrMz	Path.open}	s���	�
�;�;�=�=�	*�#�D�)�)�)���7���{�{�}�}�	*��S���#�D�)�)�)��������s��;�;���$�;�;��
O�v�
O� �!M�N�N�N��M�!7��!H��!H�!H���$������B�4�B�B�B�6�B�B�Brc�L�tj|jp|jj��Sr�)�pathlib�
PurePosixPathrr�rNr�s r�_basez
Path._base�	s���$�T�W�%B��	�0B�C�C�Crc�4�|���jSr�)rr�r�s rr�z	Path.name�	����z�z�|�|� � rc�4�|���jSr�)r�suffixr�s rrzPath.suffix�	s���z�z�|�|�"�"rc�4�|���jSr�)r�suffixesr�s rrz
Path.suffixes�	s���z�z�|�|�$�$rc�4�|���jSr�)r�stemr�s rr!z	Path.stem�	rrc�n�tj|jj���|j��Sr�)rrr�rN�joinpathrr�s rrNz
Path.filename�	s'���|�D�I�.�/�/�8�8���A�A�Arc��t|i|��\}}}|jd|g|�Ri|��5}|���cddd��S#1swxYwYdSrF)rrMrJ)r�r	r
r�strms     r�	read_textzPath.read_text�	s���!7��!H��!H�!H���$��
�T�Y�s�H�
6�t�
6�
6�
6�v�
6�
6�	�$��9�9�;�;�	�	�	�	�	�	�	�	�	�	�	�	����	�	�	�	�	�	s�A�A�Ac��|�d��5}|���cddd��S#1swxYwYdS)NrKrG)r�r%s  r�
read_byteszPath.read_bytes�	s~��
�Y�Y�t�_�_�	���9�9�;�;�	�	�	�	�	�	�	�	�	�	�	�	����	�	�	�	�	�	s�7�;�;c��tj|j�d����|j�d��kSr�)r�r|rri)r�r�s  r�	_is_childzPath._is_child�	s4��� ������!4�!4�5�5������9L�9L�L�Lrc�8�|�|j|��Sr�)r�r�)r�rs  r�_nextz
Path._next�	s���~�~�d�i��,�,�,rc�F�|jp|j�d��Sr�)rr�r�s rr�zPath.is_dir�	s!���7�{�3�d�g�.�.�s�3�3�3rc�T�|���o|���Sr�)r}r�r�s r�is_filezPath.is_file�	s ���{�{�}�}�2�T�[�[�]�]�!2�2rc�B�|j|j���vSr�)rr�r�r�s rr}zPath.exists�	s���w�$�)�-�-�/�/�/�/rc���|���std���t|j|j�����}t
|j|��S)NzCan't listdir a file)r�r�rr,r�r*�filterr*)r��subss  r�iterdirzPath.iterdir�	sR���{�{�}�}�	5��3�4�4�4��4�:�t�y�1�1�3�3�4�4���d�n�d�+�+�+rc�J�tj|jj|j��Sr�)r�r8r�rNrr�s r�__str__zPath.__str__�	s���~�d�i�0�$�'�:�:�:rc�8�|j�|���S)Nr�)�_Path__reprr�r�s rr�z
Path.__repr__�	s���{�!�!�t�!�,�,�,rc��tj|jg|�R�}|�|j�|����Sr�)r�r8rr,r�r�)r��other�nexts   rr#z
Path.joinpath�	s=���~�d�g�.��.�.�.���z�z�$�)�/�/��5�5�6�6�6rc��|js|jjStj|j�d����}|r|dz
}|�|��Sr�)rrN�parentr�r|rir,)r��	parent_ats  rr=zPath.parent�	sY���w�	(��=�'�'��%�d�g�n�n�S�&9�&9�:�:�	��	����I��z�z�)�$�$�$r)r�)r�)rrrr8r�rMrr�r�rrr!rNr&r(r*r,r�r/r}r4r6r�r#�__truediv__r=rrrrr 	s�������K�ZN�F�����C��C�C�C�C�C�(D�D�D��!�!��X�!��#�#��X�#��%�%��X�%��!�!��X�!��B�B��X�B����
���M�M�M�-�-�-�4�4�4�3�3�3�0�0�0�,�,�,�;�;�;�-�-�-�7�7�7��K�
�%�%��X�%�%�%rrc���ddl}d}|�|���}|�d���}|�dddd	�
��|�ddd
dd���|�ddddd���|�dddd�
��|�ddd�
��|�|��}|j}|j�z|j}t|d|���5}|���}ddd��n#1swxYwY|r"td�
|����td��dS|j�H|j}t|d|���5}|���ddd��dS#1swxYwYdS|j
�L|j
\}}	t|d|���5}|�|	��ddd��dS#1swxYwYdS|j��|r/td t j�!��t!jd"��|j�d��}
|j}�fd#��t|
d$��5}|D]�}t(j�|��}
|
s<t(j�t(j�|����}
|
d%t(jt(jfvrd%}
�|||
����	ddd��dS#1swxYwYdSdS)&Nrz3A simple command-line interface for zipfile module.)�descriptionT)�requiredz-lz--list�	<zipfile>zShow listing of a zipfile)�metavar�helpz-ez	--extractr")rCz<output_dir>zExtract zipfile into target dir)�nargsrDrEz-cz--create�+)z<name>z<file>zCreate zipfile from sourcesz-tz--testzTest if a zipfile is validz--metadata-encodingz
<encoding>z2Specify encoding of member names for -l, -e and -tr�)r�z.The following enclosed file is corrupted: {!r}zDone testingz/Non-conforming encodings not supported with -c.r/r!c	����tj�|��r|�||t��dStj�|��r�|r|�||��t
tj|����D]M}�|tj�||��tj�||�����LdSdSr�)	r�r�r�rnrr�rr�r8)r�r��zippath�nm�addToZips    �rrKzmain.<locals>.addToZip
s�����w�~�~�d�#�#�
P�����w��5�5�5�5�5�����t�$�$�
P��,��H�H�T�7�+�+�+� ���D�!1�!1�2�2�P�P�B��H�R��W�\�\�$��3�3�R�W�\�\�'�2�5N�5N�P�P�P�P�	
P�
P�P�Prr�r�)�argparse�ArgumentParser�add_mutually_exclusive_group�add_argument�
parse_argsr��testrr5rr�rxr1rbre�creater��stderr�exit�popr�r�r�r|rzr{)r	rLrA�parser�grouprr�r��badfilerz�zip_name�filesr�rIrKs              @r�mainr[�	s�����O�O�O�G�K�
�
$�
$��
$�
=�
=�F��/�/��/�>�>�E�	���t�X�{�7��9�9�9�	���t�[��<�=��?�?�?�
���t�Z�s�3�9��;�;�;�
���t�X�{�8��:�:�:�
���-�|�Q��S�S�S����T�"�"�D��%�H��y���i��
�S�#��
:�
:�
:�	#�b��j�j�l�l�G�	#�	#�	#�	#�	#�	#�	#�	#�	#�	#�	#����	#�	#�	#�	#��	T��B�I�I�'�R�R�S�S�S�
�n������	
��	��i��
�S�#��
:�
:�
:�	�b��K�K�M�M�M�	�	�	�	�	�	�	�	�	�	�	�	����	�	�	�	�	�	�
��	!��l���V�
�S�#��
:�
:�
:�	"�b��M�M�&�!�!�!�	"�	"�	"�	"�	"�	"�	"�	"�	"�	"�	"�	"����	"�	"�	"�	"�	"�	"�
��	 ��	��C��z�
#�
#�
#�
#��H�Q�K�K�K��;�?�?�1�%�%�����	P�	P�	P�	P�	P��X�s�
#�
#�	,�r��
,�
,���'�*�*�4�0�0���F� �g�.�.�r�w���t�/D�/D�E�E�G��r�2�9�b�i�8�8�8� �G����T�7�+�+�+�+�

,�	,�	,�	,�	,�	,�	,�	,�	,�	,�	,�	,�	,����	,�	,�	,�	,�	,�	,�)
!�	 sI�.D�D�D�/F�F�F�G$�$G(�+G(� B
K;�;K?�K?�__main__r�)��binascii�importlib.utilr�r�r�r�r��rer�r�rSr�r�r�rrr;r��ImportErrorr=r�__all__�	Exceptionrrrrr�r�rBrrrr	r�r�r�r�rrwrvr�rurYrZr[r\r]r^r_r{rr
rrrr�_CD_CREATE_VERSION�_CD_CREATE_SYSTEM�_CD_EXTRACT_VERSION�_CD_EXTRACT_SYSTEMr�_CD_COMPRESS_TYPE�_CD_TIME�_CD_DATE�_CD_CRC�_CD_COMPRESSED_SIZE�_CD_UNCOMPRESSED_SIZErrr�_CD_DISK_NUMBER_START�_CD_INTERNAL_FILE_ATTRIBUTES�_CD_EXTERNAL_FILE_ATTRIBUTESrrTr\r�rQrRr�r�r�rMrN�_FH_EXTRACT_VERSION�_FH_EXTRACT_SYSTEMrS�_FH_COMPRESSION_METHOD�_FH_LAST_MOD_TIME�_FH_LAST_MOD_DATE�_FH_CRC�_FH_COMPRESSED_SIZE�_FH_UNCOMPRESSED_SIZErOrPrTrUrRrWrXrV�_CD64_SIGNATURE�_CD64_DIRECTORY_RECSIZE�_CD64_CREATE_VERSION�_CD64_EXTRACT_VERSION�_CD64_DISK_NUMBER�_CD64_DISK_NUMBER_START�_CD64_NUMBER_ENTRIES_THIS_DISK�_CD64_NUMBER_ENTRIES_TOTAL�_CD64_DIRECTORY_SIZE�_CD64_OFFSET_START_CENTDIRr��Structr4rBrHr
rqrD�objectrr
r�rrr#r�r@rHrMrOrir�rtr�rr
r�r��dict�fromkeysr�r�r�r�rrr[rrrr�<module>r�s?���
��������	�	�	�	�����	�	�	�	�����	�	�	�	�
�
�
�
�����
�
�
�
�
�
�
�
�������������������K�K�K��J�E�E�������D��N�E�E�E�������J�J�J�J������
�C�C�C�������K�K�K�K�������D�D�D���������
	�	�	�	�	��	�	�	������9���� ���
���#�����
����	�
�����
��
������� �� ���!1�2�2������������
�	��������
�$�� �� ���!1�2�2���
����������
�������
��������������!��!������ ��
#�� �� ��
��"�� �� ���!1�2�2���
����� !��������
����������%��)��)�&�/�*C�D�D��"��"��"�6�?�#5�6�6��������������!"���������
�#�f�m�E�*�*�����*������ (�(�(�V:�:�:�z`�`�`�`�`�v�`�`�`�N
�	���� #�#�#�L"�"�"�"�"�"�"�"�.��������8��w���x���x���x�	�
�x���x�
��y���z���y���{���	�������������� �	�!�"��#��(N�N�N�&
�
�
�
� P�P�P�$%!�%!�%!�%!�%!�%!�%!�%!�P��������(F�F�F�F�F��"�F�F�F�R
P+�P+�P+�P+�P+�B�%�P+�P+�P+�hS�S�S�S�S�S�S�S�lk$�k$�k$�k$�k$��k$�k$�k$�\6�6�6�&+�+�+�6�-��/�H�H�H�9�9�9�9�9�7�9�9�9�x���������&7�7�7�7�
y%�y%�y%�y%�y%�y%�y%�y%�xC,�C,�C,�C,�L�z����D�F�F�F�F�F��s5�A�A�A� A%�%A/�.A/�3A8�8B�B