Hacked By AnonymousFox
�
c��f
^ � �r � d Z ddlZddlZddlZddlZddlZddlZddlZddlZg d�Z d\ Z
ZZZ
Zd\ ZZdZdZdZd edddfd
�Zd� Z G d� d
� � Z G d� de� � Z G d� dej � � Zd� Zd� Z G d� dej � � Z ddede fd�Z!efdd�d�Z"d� Z#d� Z$e%dk r e$� � dS dS )z�Functions that read and write gzipped files.
The user of the file doesn't have to worry about the compression,
but random access is not allowed.� N)�BadGzipFile�GzipFile�open�compress�
decompress)� � � � � )r r r � � �rbc �" � d|v rd|v rt d|��� � �n3|�t d� � �|�t d� � �|�t d� � �|� dd� � }t | t t t
j f� � rt | ||� � }nBt | d � � st | d
� � rt d||| � � }nt d� � �d|v r+t j |� � }t j ||||� � S |S )a Open a gzip-compressed file in binary or text mode.
The filename argument can be an actual filename (a str or bytes object), or
an existing file object to read from or write to.
The mode argument can be "r", "rb", "w", "wb", "x", "xb", "a" or "ab" for
binary mode, or "rt", "wt", "xt" or "at" for text mode. The default mode is
"rb", and the default compresslevel is 9.
For binary mode, this function is equivalent to the GzipFile constructor:
GzipFile(filename, mode, compresslevel). In this case, the encoding, errors
and newline arguments must not be provided.
For text mode, a GzipFile object is created, and wrapped in an
io.TextIOWrapper instance with the specified encoding, error handling
behavior, and line ending(s).
�t�bzInvalid mode: Nz0Argument '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.pyr r s2 � �( �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 � | � t j d|� � � � d S )Nz<L)r �struct�pack)�output�values r* �write32ur1 F s( � � �L�L���T�5�)�)�*�*�*�*�*r+ c �4 � e Zd ZdZd d�Zd� Zd d�Zd� Zd� ZdS )
�_PaddedFilez�Minimal read-only file object that prepends a string to the contents
of an actual file. Shouldn't be used outside of gzip.py, as it lacks
essential functionality.r+ c �X � || _ t |� � | _ || _ d| _ d S �Nr )�_buffer�len�_length�file�_read)�self�f�prepends r* �__init__z_PaddedFile.__init__P s( � �����7�|�|����� ���
�
�
r+ c �F � | j �| j � |� � S | j |z | j k r+| j }| xj |z
c_ | j || j � S | j }d | _ | j |d � | j � || j z
|z � � z S �N)r: r9 r r8 r6 )r; �sizer s r* r z_PaddedFile.readV s� � ��:���9�>�>�$�'�'�'��:�����,�,��:�D��J�J�$��J�J��<��T�Z��0�0��:�D��D�J��<����&��9�>�>�$�t�|�"3�D�"8�9�9�:�
:r+ c � � | j �|| _ n| xj t |� � z c_ d S t | j � � | _ d| _ d S r5 )r: r6 r7 r8 )r; r= s r* r= z_PaddedFile.prependc sJ � ��:��"�D�L�L��J�J�#�g�,�,�&�J�J��F��4�<�(�(�����
�
�
r+ c �R � d | _ d | _ | j � |� � S r@ )r: r6 r9 �seek)r; �offs r* rD z_PaddedFile.seekl s$ � ���
�����y�~�~�c�"�"�"r+ c � � dS �NT� �r; s r* �seekablez_PaddedFile.seekableq � � ��tr+ N)r+ ) �__name__�
__module__�__qualname__�__doc__r>