Your IP : 18.119.253.198


Current Path : /opt/alt/python311/lib64/python3.11/__pycache__/
Upload File :
Current File : //opt/alt/python311/lib64/python3.11/__pycache__/gzip.cpython-311.opt-2.pyc

�

c��f
^��p�	ddlZddlZddlZddlZddlZddlZddlZddlZgd�Zd\Z	Z
ZZZ
d\ZZdZdZdZdedddfd	�Zd
�ZGd�d��ZGd
�de��ZGd�dej��Zd�Zd�ZGd�dej��Z	ddedefd�Z efdd�d�Z!d�Z"d�Z#e$dkre#��dSdS)�N)�BadGzipFile�GzipFile�open�compress�
decompress)�����)rr	r��	�rbc�$�	d|vrd|vrtd|�����n3|�td���|�td���|�td���|�dd��}t|ttt
jf��rt|||��}nBt|d��st|d	��rtd|||��}ntd
���d|vr+tj|��}tj||||��S|S)N�t�bzInvalid mode: z0Argument 'encoding' not supported in binary modez.Argument 'errors' not supported in binary modez/Argument 'newline' not supported in binary mode��read�writez1filename must be a str or bytes object, or a file)
�
ValueError�replace�
isinstance�str�bytes�os�PathLiker�hasattr�	TypeError�io�
text_encoding�
TextIOWrapper)�filename�mode�
compresslevel�encoding�errors�newline�gz_mode�binary_files        �+/opt/alt/python311/lib64/python3.11/gzip.pyrrs7���$�d�{�{��$�;�;��*�4�4�9�:�:�:�����O�P�P�P����M�N�N�N����N�O�O�O��l�l�3��#�#�G��(�S�%���5�6�6�M��x��-�@�@���	��6�	"�	"�M�g�h��&@�&@�M��t�W�m�X�F�F����K�L�L�L�
�d�{�{��#�H�-�-�����X�v�w�G�G�G���c�V�|�tjd|����dS)Nz<L)r�struct�pack)�output�values  r*�write32ur1Fs(���L�L���T�5�)�)�*�*�*�*�*r+c�2�eZdZ	dd�Zd�Zdd�Zd�Zd�ZdS)	�_PaddedFiler+c�X�||_t|��|_||_d|_dS�Nr)�_buffer�len�_length�file�_read)�self�f�prepends   r*�__init__z_PaddedFile.__init__Ps(������7�|�|�����	���
�
�
r+c�F�|j�|j�|��S|j|z|jkr+|j}|xj|z
c_|j||j�S|j}d|_|j|d�|j�||jz
|z��zS�N)r:r9rr8r6)r;�sizers   r*rz_PaddedFile.readVs����:���9�>�>�$�'�'�'��:�����,�,��:�D��J�J�$��J�J��<��T�Z��0�0��:�D��D�J��<����&��9�>�>�$�t�|�"3�D�"8�9�9�:�
:r+c��|j�||_n|xjt|��zc_dSt|j��|_d|_dSr5)r:r6r7r8)r;r=s  r*r=z_PaddedFile.prependcsJ���:��"�D�L�L��J�J�#�g�,�,�&�J�J��F��4�<�(�(�����
�
�
r+c�R�d|_d|_|j�|��Sr@)r:r6r9�seek)r;�offs  r*rDz_PaddedFile.seekls$����
�����y�~�~�c�"�"�"r+c��dS�NT��r;s r*�seekablez_PaddedFile.seekableq����tr+N)r+)�__name__�
__module__�__qualname__r>rr=rDrJrHr+r*r3r3Ksn������ �����:�:�:�����#�#�#�
����r+r3c��eZdZdS)rN)rLrMrNrHr+r*rrus������@�@r+rc���eZdZ	dZddeddfd�Zed���Zed���Zd�Z	d�Z
d�Zd�Zdd
�Z
dd�Zd�Zed
���Zd�Zejfd�Zd�Zd�Zd�Zd�Zd�Zejfd�Zdd�ZdS)rNc���	|r*d|vsd|vr"td�|�����|r	d|vr|dz
}|�tj||pd��x}|_|�0t|dd��}t
|ttf��sd}ntj
|��}|}|�t|dd��}|�d	��r<t|_
t|��}tj|��|_||_n�|�d
��r�|� ddl}|�dt*d
��t,|_
|�|��t1j|t0jt0jt0jd��|_||_n"td�|�����||_|j
t,kr|� |��dSdS)Nr�UzInvalid mode: {!r}rr�namerr#�r)�w�a�xrz�GzipFile was opened for writing, but this will change in future Python releases.  Specify the mode argument for opening it for writing.r	)!r�format�builtinsr�	myfileobj�getattrrrrr�fspath�
startswith�READr#�_GzipReaderr�BufferedReaderr6rS�warnings�warn�
FutureWarning�WRITE�_init_write�zlib�compressobj�DEFLATED�	MAX_WBITS�
DEF_MEM_LEVELr�_write_mtime�fileobj�_write_gzip_header)	r;r"r#r$rl�mtime�origmode�rawras	         r*r>zGzipFile.__init__�s
��	�B�	@�S�D�[�[�C�4�K�K��1�8�8��>�>�?�?�?��	�C�t�O�O��C�K�D��?�'/�}�X�t�|�t�'L�'L�L�G�d�n����w���3�3�H��h��e��5�5�
�����y��*�*�H����<��7�F�D�1�1�D��?�?�3���	@��D�I��g�&�&�C��,�S�1�1�D�L� �D�I�I�
�_�_�_�
-�
-�	@��������
�
�L�"�1�	&�&�&�
�D�I����X�&�&�&� �,�]�-1�]�.2�n�_�-1�-?�-.�	0�0�D�M�
!&�D����1�8�8��>�>�?�?�?�����9�����#�#�M�2�2�2�2�2��r+c��ddl}|�dtd��|jtkr|jdd�dkr
|jdzS|jS)Nrzuse the name attributer	����.gz)rarb�DeprecationWarningr#rdrS)r;ras  r*r"zGzipFile.filename�sY�������
�
�.�0B�A�F�F�F��9����$�)�B�C�C�.�E�"9�"9��9�u�$�$��y�r+c�&�	|jjjSr@)r6rp�_last_mtimerIs r*rnzGzipFile.mtime�s��>��|��+�+r+c��t|j��}d|dd�zdztt|����zdzS)Nz<gzip r���� �>)�reprrl�hex�id)r;�ss  r*�__repr__zGzipFile.__repr__�s?���������!�A�b�D�'�!�C�'�#�b��h�h�-�-�7�#�=�=r+c�~�||_tjd��|_d|_g|_d|_d|_dS�Nr+r)rSrf�crc32�crcrA�writebuf�bufsize�offset)r;r"s  r*rezGzipFile._init_write�s8����	��:�c�?�?�����	���
��������r+c�\�|j�d��|j�d��	tj�|j��}t
|t��s|�d��}|�	d��r
|dd�}n#t$rd}YnwxYwd}|rt}|j�t|���d����|j
}|�tj��}t|jt!|����|t"krd}n|t$krd	}nd
}|j�|��|j�d��|r|j�|d
z��dSdS)N���zlatin-1s.gzrrr+r�����)rlrr�path�basenamerSrr�encode�endswith�UnicodeEncodeError�FNAME�chrrk�timer1�int�_COMPRESS_LEVEL_BEST�_COMPRESS_LEVEL_FAST)r;r$�fname�flagsrn�xfls      r*rmzGzipFile._write_gzip_header�s�������;�'�'�'�����7�#�#�#�		��G�$�$�T�Y�/�/�E��e�U�+�+�
0����Y�/�/���~�~�f�%�%�
#��c�r�c�
����!�	�	�	��E�E�E�	�������	��E�����3�u�:�:�,�,�Y�7�7�8�8�8��!���=��I�K�K�E����s�5�z�z�*�*�*��0�0�0��C�C�
�2�
2�
2��C�C��C�����3��������7�#�#�#��	0��L���u�w��/�/�/�/�/�	0�	0s�A-B$�$B3�2B3c��|���|jtkrddl}t	|jd���|j�td���t|ttf��rt|��}nt|��}|j
}|dkrq|j�|j�|����|xj|z
c_t#j||j��|_|xj|z
c_|S)Nrz$write() on read-only GzipFile objectz!write() on closed GzipFile object)�_check_not_closedr#rd�errno�OSError�EBADFrlrrr�	bytearrayr7�
memoryview�nbytesrrrArfr�r�r�)r;�datar��lengths    r*rzGzipFile.writes������ � � ��9�����L�L�L��%�+�'M�N�N�N��<���@�A�A�A��d�U�I�.�/�/�	!���Y�Y�F�F��d�#�#�D��[�F��A�:�:��L���t�}�5�5�d�;�;�<�<�<��I�I���I�I��z�$���1�1�D�H��K�K�6�!�K�K��
r+rxc��|���|jtkrddl}t	|jd���|j�|��S)Nrz$read() on write-only GzipFile object)r�r#r^r�r�r�r6r�r;rAr�s   r*rz
GzipFile.read(sS����� � � ��9�����L�L�L��%�+�'M�N�N�N��|� � ��&�&�&r+c���	|���|jtkrddl}t	|jd���|dkrtj}|j�	|��S)Nrz%read1() on write-only GzipFile object)
r�r#r^r�r�r�r�DEFAULT_BUFFER_SIZEr6�read1r�s   r*r�zGzipFile.read1/sl��	E�	
��� � � ��9�����L�L�L��%�+�'N�O�O�O��!�8�8��)�D��|�!�!�$�'�'�'r+c��|���|jtkrddl}t	|jd���|j�|��S)Nrz$peek() on write-only GzipFile object)r�r#r^r�r�r�r6�peek)r;�nr�s   r*r�z
GzipFile.peek<sS����� � � ��9�����L�L�L��%�+�'M�N�N�N��|� � ��#�#�#r+c��|jduSr@)rlrIs r*�closedzGzipFile.closedCs���|�t�#�#r+c���|j}|�dSd|_	|jtkrZ|�|j�����t
||j��t
||jdz��n)|jtkr|j
���|j}|rd|_|���dSdS#|j}|rd|_|���wwxYw)N���)
rlr#rdrr�flushr1r�rAr^r6�closerZ)r;rlrZs   r*r�zGzipFile.closeGs���,���?��F����	"��y�E�!�!��
�
�d�m�1�1�3�3�4�4�4���$�(�+�+�+���$�)�j�"8�9�9�9�9���d�"�"���"�"�$�$�$���I��
"�!%������!�!�!�!�!�
"�
"����I��
"�!%������!�!�!�!�
"���s�BC�'C6c���|���|jtkrM|j�|j�|����|j���dSdSr@)r�r#rdrlrrr�)r;�	zlib_modes  r*r�zGzipFile.flushZsi����� � � ��9�����L���t�}�2�2�9�=�=�>�>�>��L��� � � � � ��r+c�6�	|j���Sr@)rl�filenorIs r*r�zGzipFile.filenoas��	�
�|�"�"�$�$�$r+c�z�	|jtkrtd���|j�d��dS)NzCan't rewind in write moder)r#r^r�r6rDrIs r*�rewindzGzipFile.rewindis?��	!��9�����6�7�7�7�����!�����r+c�"�|jtkSr@)r#r^rIs r*�readablezGzipFile.readableps���y�D� � r+c�"�|jtkSr@)r#rdrIs r*�writablezGzipFile.writabless���y�E�!�!r+c��dSrGrHrIs r*rJzGzipFile.seekablevrKr+c��|jtkr�|tjkr*|tjkr|j|z}nt
d���||jkrtd���||jz
}d}t|dz��D]}|�	|���|�	d|dzz��n?|jtkr/|���|j�
||��S|jS)NzSeek from end not supportedzNegative seek in write modesir�)r#rdr�SEEK_SET�SEEK_CURr�rr��rangerr^r�r6rD)r;r��whence�count�chunk�is      r*rDz
GzipFile.seekys���9�������$�$��R�[�(�(�!�[�6�1�F�F�$�%B�C�C�C����#�#��;�<�<�<��T�[�(�E� �E��5�D�=�)�)�
"�
"���
�
�5�!�!�!�!��J�J�u����-�.�.�.�.�
�Y�$�
�
��"�"�$�$�$��<�$�$�V�V�4�4�4��{�r+c�^�|���|j�|��Sr@)r�r6�readline)r;rAs  r*r�zGzipFile.readline�s*����� � � ��|�$�$�T�*�*�*r+�rx)rLrMrNrZr�r>�propertyr"rnrrermrrr�r�r�r�rf�Z_SYNC_FLUSHr�r�r�r�r�rJrr�rDr�rHr+r*rrys���������I� $�4�3�T��O3�O3�O3�O3�b����X���,�,��X�,�>�>�>����0�0�0�@���0'�'�'�'�(�(�(�(�$�$�$��$�$��X�$�"�"�"�&"�.�!�!�!�!�%�%�%����!�!�!�"�"�"����#%�+�����(+�+�+�+�+�+r+rc���	|�|��}t|��|krN|�|t|��z
��}|std���||z
}t|��|k�N|S)N�ACompressed file ended before the end-of-stream marker was reached)rr7�EOFError)�fpr�r�rs    r*�_read_exactr��s����
�7�7�1�:�:�D�

�d�)�)�a�-�-��G�G�A��D�	�	�M�"�"���	?��>�?�?�
?���	���d�)�)�a�-�-��Kr+c�D�	|�d��}|dkrdS|dkrtd|z���tjdt	|d����\}}}|dkrtd���|t
zr5tjdt	|d����\}t	||��|tzr 	|�d
��}|r|dkrn�|tzr 	|�d
��}|r|dkrn�|tzrt	|d��|S)Nr	r+r�zNot a gzipped file (%r)z<BBIxxrzUnknown compression methodz<HTrr�)	rrr-�unpackr��FEXTRAr��FCOMMENT�FHCRC)r��magic�method�flag�
last_mtime�	extra_lenr~s       r*�_read_gzip_headerr��sN���
�G�G�A�J�J�E���|�|��t������3�e�;�<�<�<�!'��x��R��9K�9K�!L�!L��V�T�:�
��{�{��6�7�7�7��f�}�#��]�4��R��);�);�<�<�
�	��B�	�"�"�"��e�|��	�����
�
�A��
��7�
�
��	��h���	�����
�
�A��
��7�
�
��	��e�|���B������r+c�H��eZdZ�fd�Zd�Zd�Zd	d�Zd�Zd�Z�fd�Z	�xZ
S)
r_c���t���t|��tjtj���d|_d|_dS)N��wbitsT)�superr>r3rf�
decompressobjri�_new_memberrv)r;r��	__class__s  �r*r>z_GzipReader.__init__�sP���
������R���$�*<� $���	�	0�	0�	0� �������r+c�F�tjd��|_d|_dSr�)rfr��_crc�_stream_sizerIs r*�
_init_readz_GzipReader._init_read�s���J�s�O�O��	�����r+c�D�t|j��}|�dS||_dS)NFT)r��_fprv)r;r�s  r*r�z_GzipReader._read_gzip_header�s)��&�t�x�0�0�
����5�%����tr+rxc�8�|dkr|���S|sdS	|jjr2|���d|_|jdi|j��|_|jr=|���|���s|j	|_
dSd|_|j�tj��}|j�||��}|jjdkr%|j�|jj��n4|jjdkr$|j�|jj��|dkrn|dkrt'd�����H|�|��|xj	t+|��z
c_	|S)Nrr+TFr�rH)�readall�
_decompressor�eof�	_read_eofr��_decomp_factory�_decomp_argsr�r��_pos�_sizer�rrr�r�unconsumed_tailr=�unused_datar��_add_read_datar7)r;rA�buf�
uncompresss    r*rz_GzipReader.read�s����!�8�8��<�<�>�>�!��	��3�
#	C��!�%�
)�
��� � � �#'�� �%9�T�%9�&)�&)��'�&)�&)��"���
)����!�!�!��-�-�/�/��!%��D�J��3�#(�� ��(�-�-�� 6�7�7�C��+�6�6�s�D�A�A�J��!�1�S�8�8��� � ��!3�!C�D�D�D�D��#�/�3�6�6��� � ��!3�!?�@�@�@��S� � ���c�z�z�� B�C�C�C�E#	C�J	
���Z�)�)�)��	�	�S��_�_�$�	�	��r+c�|�tj||j��|_|jt	|��z|_dSr@)rfr�r�r�r7)r;r�s  r*r�z_GzipReader._add_read_data
s3���J�t�T�Y�/�/��	� �-��D�	�	�9����r+c��tjdt|jd����\}}||jkr4tdt
|���dt
|j�������||jdzkrtd���d}|dkr |j�d��}|dk� |r|j�	|��dSdS)	N�<IIrzCRC check failed z != r��!Incorrect length of data producedr�r)
r-r�r�r�r�rr|r�rr=)r;r��isize�cs    r*r�z_GzipReader._read_eofs���
�}�U�K���!�,D�,D�E�E���u��D�I����+�S��Z�Z�Z�Z�=@���^�^�^�M�N�N�
N�
�t�(�:�5�
6�
6��A�B�B�B�

���7�l�l���
�
�a� � �A��7�l�l��	 ��H���Q������	 �	 r+c�V��t�����d|_dSrG)r��_rewindr�)r;r�s �r*r�z_GzipReader._rewind&s%���
������������r+r�)rLrMrNr>r�r�rr�r�r��
__classcell__)r�s@r*r_r_�s�������� � � � � �������1�1�1�1�f:�:�:� � � �* � � � � � � � � r+r_r$�returnc
��	|�tj��}|tkrd}n|tkrd}nd}tjdddddt|��|d��S)	Nr	r
rz<BBBBLBB��r�)r�r�r�r-r.r�)r$rnr�s   r*�_create_simple_gzip_headerr+sj���
�}��	�����,�,�,����	�.�	.�	.�������;�z�4��q�!�S��Z�Z��c�J�J�Jr+)rnc��	|dkrtj||d���St||��}tjdtj|��t
|��dz��}|tj||d���z|zS)Nrr)�levelr�z<LLr�i�)rfrrr-r.r�r7)r�r$rn�header�trailers     r*rr@s����
��z�z��}�T��b�A�A�A�A�
'�
�u�
=�
=�F��k�%���D�!1�!1�C��I�I�
�4J�L�L�G��T�]�4�}�C�H�H�H�H��
�r+c���	g}	tj|��}t|���d�|��St	jtj���}|�||���d���}|j	rt|j��dkrtd���tjd|jdd���\}}|t	j|��krt!d���|t|��dzkrt!d	���|�|��|jdd��d
��}��_)NTr+r�rr�r�zCRC check failedr�r�r�)r�BytesIOr��joinrfr�rir�tellr�r7r�r�r-r�r�r�append�lstrip)r��decompressed_membersr��do�decompressedr�r�s       r*rrRsT�����2�
�Z��
�
���R� � �(��8�8�0�1�1�1�
�
�t�~�o�
6�
6�
6���}�}�T�"�'�'�)�)�*�*�%5�6�6���v�	1��R�^�,�,�q�0�0��0�1�1�
1��m�E�2�>�"�1�"�+=�>�>���V��$�*�\�*�*�*�*��0�1�1�1��c�,�'�'�*�4�5�5��A�B�B�B��#�#�L�1�1�1��~�a�b�b�!�(�(��1�1��#2r+c��ddlm}|d���}|���}|�ddd���|�d	dd
���|�dddd
���|�dddgd���|���}t
}|jrt}n|jrt}|j
D�]}|jr�|dkr3tddtjj���}tjj}n�|dd�dkrtjd|����t%|d��}t'j|dd�d��}nb|dkr4tjj}tddtjj|���}n(t'j|d��}t%|dzd��}	|�t*j��}|sn|�|���8|tjjur|���|tjjur|������dS)Nr)�ArgumentParserzeA simple command line interface for the gzip module: act like gzip, but do not delete the input file.)�descriptionz--fast�
store_truezcompress faster)�action�helpz--bestzcompress betterz-dz--decompresszact like gunzip instead of gzip�args�*�-r9)�nargs�default�metavarrr)r"r#rlrrrszfilename doesn't end in .gz: �wb)r"r#rlr$)�argparser�add_mutually_exclusive_group�add_argument�
parse_args�_COMPRESS_LEVEL_TRADEOFF�fastr��bestr�rrr�sys�stdin�buffer�stdout�exitrrYrrr�rr�)	r�parser�grouprr$�argr<�gr�s	         r*�mainr1kss��'�'�'�'�'�'�
�^�	,�-�-�-�F�
�/�/�1�1�E�	���x��;L��M�M�M�	���x��;L��M�M�M�	���t�^�L�>��@�@�@�����c�C�5�&��I�I�I������D�,�M��y�-�,�
�
�	
��-�,�
��y�����?�	,��c�z�z��b�t�S�Y�=M�N�N�N���J�%����r�s�s�8�u�$�$��H�D�S�D�D�E�E�E���d�O�O���M�#�c�r�c�(�D�1�1����c�z�z��I�$���b�t�S�Z�=N�+8�:�:�:����M�#�t�,�,����u��d�+�+��	��F�F�2�1�2�2�E��
��
�G�G�E�N�N�N�		�

�C�J�%�%�%�
�G�G�I�I�I��C�I�$�$�$�
�G�G�I�I�I��5�r+�__main__r@)%r-r(r�rrfrYr�_compression�__all__�FTEXTr�r�r�r�r^rdr�r%r�rr1r3r�r�
BaseStreamrr�r��DecompressReaderr_r�rrrrr1rLrHr+r*�<module>r8sN��%�������������������������	�	�	�	�����
G�
G�
G��(6�%��u�f�e�X����e��������,@��t�T�+�+�+�+�Z+�+�+�
'�'�'�'�'�'�'�'�TA�A�A�A�A�'�A�A�A�V+�V+�V+�V+�V+�|�&�V+�V+�V+�r
�
�
� "�"�"�Ja �a �a �a �a �,�/�a �a �a �J(,�K�K�c�K�05�K�K�K�K�*"6��������$2�2�2�2.�.�.�`�z����D�F�F�F�F�F��r+

?>