ok

Mini Shell

Direktori : /opt/alt/python311/lib64/python3.11/__pycache__/
Upload File :
Current File : //opt/alt/python311/lib64/python3.11/__pycache__/codecs.cpython-311.pyc

�

�f���T�dZddlZddlZ	ddlTn#e$rZedez���dZ[wwxYwgd�ZdZdxZ	Z
dxZZd	Z
d
Zejdkre
xZZe
ZnexZZeZe
ZeZe
ZeZGd�d
e��ZGd�d��ZGd�de��ZGd�de��ZGd�de��ZGd�de��ZGd�de��ZGd�de��Z Gd�d��Z!Gd�d��Z"d7d#�Z#d8d$�Z$d%�Z%d&�Z&d'�Z'd(�Z(d)�Z)d*�Z*d9d+�Z+d9d,�Z,d-�Z-d.�Z.	e/d!��Z0e/d/��Z1e/d0��Z2e/d1��Z3e/d2��Z4e/d3��Z5n#e6$rdZ0dZ1dZ2dZ3dZ4dZ5YnwxYwdZ7e7rddl8Z8e9d4kr0e$ej:d5d6��e_:e$ej;d6d5��e_;dSdS):z� codecs -- Python Codec Registry, API and helpers.


Written by Marc-Andre Lemburg (mal@lemburg.com).

(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.

�N)�*z%Failed to load the builtin codecs: %s),�register�lookup�open�EncodedFile�BOM�BOM_BE�BOM_LE�BOM32_BE�BOM32_LE�BOM64_BE�BOM64_LE�BOM_UTF8�	BOM_UTF16�BOM_UTF16_LE�BOM_UTF16_BE�	BOM_UTF32�BOM_UTF32_LE�BOM_UTF32_BE�	CodecInfo�Codec�IncrementalEncoder�IncrementalDecoder�StreamReader�StreamWriter�StreamReaderWriter�
StreamRecoder�
getencoder�
getdecoder�getincrementalencoder�getincrementaldecoder�	getreader�	getwriter�encode�decode�
iterencode�
iterdecode�
strict_errors�
ignore_errors�replace_errors�xmlcharrefreplace_errors�backslashreplace_errors�namereplace_errors�register_error�lookup_errorss��s��s��s���littlec�.�eZdZdZdZ		ddd�d�Zd�ZdS)rz0Codec details when looking up the codec registryTN)�_is_text_encodingc��t�|||||f��}	||	_||	_||	_||	_||	_||	_||	_|�||	_	|	S�N)
�tuple�__new__�namer$r%�incrementalencoder�incrementaldecoder�streamwriter�streamreaderr2)
�clsr$r%r;r:r8r9r7r2�selfs
          �-/opt/alt/python311/lib64/python3.11/codecs.pyr6zCodecInfo.__new__^sh���}�}�S�6�6�<��"N�O�O����	�������"4���"4���(���(����(�%6�D�"���c�`�d|jj|jj|jt	|��fzS)Nz%<%s.%s object for encoding %s at %#x>)�	__class__�
__module__�__qualname__r7�id�r=s r>�__repr__zCodecInfo.__repr__ms0��6���*�D�N�,G���B�t�H�H�&�&�	&r?)NNNNN)�__name__rBrC�__doc__r2r6rF�r?r>rrSsX������:�:���EI�?C�
�!�
�
�
�
�
�&�&�&�&�&r?rc�"�eZdZdZdd�Zdd�ZdS)ra9 Defines the interface for stateless encoders/decoders.

        The .encode()/.decode() methods may use different error
        handling schemes by providing the errors argument. These
        string values are predefined:

         'strict' - raise a ValueError error (or a subclass)
         'ignore' - ignore the character and continue with the next
         'replace' - replace with a suitable replacement character;
                    Python will use the official U+FFFD REPLACEMENT
                    CHARACTER for the builtin Unicode codecs on
                    decoding and '?' on encoding.
         'surrogateescape' - replace with private code points U+DCnn.
         'xmlcharrefreplace' - Replace with the appropriate XML
                               character reference (only for encoding).
         'backslashreplace'  - Replace with backslashed escape sequences.
         'namereplace'       - Replace with \N{...} escape sequences
                               (only for encoding).

        The set of allowed values can be extended via register_error.

    �strictc��t�)a# Encodes the object input and returns a tuple (output
            object, length consumed).

            errors defines the error handling to apply. It defaults to
            'strict' handling.

            The method may not store state in the Codec instance. Use
            StreamWriter for codecs which have to keep state in order to
            make encoding efficient.

            The encoder must be able to handle zero length input and
            return an empty object of the output object type in this
            situation.

        ��NotImplementedError�r=�input�errorss   r>r$zCodec.encode�s
��""�!r?c��t�)a� Decodes the object input and returns a tuple (output
            object, length consumed).

            input must be an object which provides the bf_getreadbuf
            buffer slot. Python strings, buffer objects and memory
            mapped files are examples of objects providing this slot.

            errors defines the error handling to apply. It defaults to
            'strict' handling.

            The method may not store state in the Codec instance. Use
            StreamReader for codecs which have to keep state in order to
            make decoding efficient.

            The decoder must be able to handle zero length input and
            return an empty object of the output object type in this
            situation.

        rMrOs   r>r%zCodec.decode�s
��*"�!r?N�rK)rGrBrCrHr$r%rIr?r>rrrsF��������,"�"�"�"�&"�"�"�"�"�"r?rc�4�eZdZdZd
d�Zdd�Zd�Zd�Zd�Zd	S)rz�
    An IncrementalEncoder encodes an input in multiple steps. The input can
    be passed piece by piece to the encode() method. The IncrementalEncoder
    remembers the state of the encoding process between calls to encode().
    rKc�"�||_d|_dS)z�
        Creates an IncrementalEncoder instance.

        The IncrementalEncoder may use different error handling schemes by
        providing the errors keyword argument. See the module docstring
        for a list of possible values.
        �N)rQ�buffer�r=rQs  r>�__init__zIncrementalEncoder.__init__�s���������r?Fc��t�)zA
        Encodes input and returns the resulting object.
        rM�r=rP�finals   r>r$zIncrementalEncoder.encode��
��"�!r?c��dS)z:
        Resets the encoder to the initial state.
        NrIrEs r>�resetzIncrementalEncoder.reset�����r?c��dS)z:
        Return the current state of the encoder.
        rrIrEs r>�getstatezIncrementalEncoder.getstate�s	���qr?c��dS)zl
        Set the current state of the encoder. state must have been
        returned by getstate().
        NrI�r=�states  r>�setstatezIncrementalEncoder.setstate�r`r?NrS�F)	rGrBrCrHrYr$r_rbrfrIr?r>rr�ss��������
	�	�	�	�"�"�"�"����
�������r?rc�:�eZdZdZdd�Zd�Zdd�Zd�Zd�Zd	�Z	d
S)
�BufferedIncrementalEncoderz�
    This subclass of IncrementalEncoder can be used as the baseclass for an
    incremental encoder if the encoder must keep some of the output in a
    buffer between calls to encode().
    rKc�J�t�||��d|_dS�NrV)rrYrWrXs  r>rYz#BufferedIncrementalEncoder.__init__�s#���#�#�D�&�1�1�1�����r?c��t�r4rM�r=rPrQr\s    r>�_buffer_encodez)BufferedIncrementalEncoder._buffer_encode��
��"�!r?Fc�v�|j|z}|�||j|��\}}||d�|_|Sr4)rWrnrQ�r=rPr\�data�result�consumeds      r>r$z!BufferedIncrementalEncoder.encode��@���{�U�"��!�0�0��t�{�E�J�J�����8�9�9�o����
r?c�H�t�|��d|_dSrk)rr_rWrEs r>r_z BufferedIncrementalEncoder.reset�s!��� � ��&�&�&�����r?c��|jpdS�Nr�rWrEs r>rbz#BufferedIncrementalEncoder.getstate�s���{��a�r?c��|pd|_dSrkryrds  r>rfz#BufferedIncrementalEncoder.setstate�s���k�r����r?NrSrg)
rGrBrCrHrYrnr$r_rbrfrIr?r>riri�s���������
����
"�"�"�
������� � � �"�"�"�"�"r?ric�4�eZdZdZd
d�Zdd�Zd�Zd�Zd�Zd	S)rz�
    An IncrementalDecoder decodes an input in multiple steps. The input can
    be passed piece by piece to the decode() method. The IncrementalDecoder
    remembers the state of the decoding process between calls to decode().
    rKc��||_dS)z�
        Create an IncrementalDecoder instance.

        The IncrementalDecoder may use different error handling schemes by
        providing the errors keyword argument. See the module docstring
        for a list of possible values.
        N)rQrXs  r>rYzIncrementalDecoder.__init__s������r?Fc��t�)z@
        Decode input and returns the resulting object.
        rMr[s   r>r%zIncrementalDecoder.decoder]r?c��dS)z9
        Reset the decoder to the initial state.
        NrIrEs r>r_zIncrementalDecoder.resetr`r?c��dS)a	
        Return the current state of the decoder.

        This must be a (buffered_input, additional_state_info) tuple.
        buffered_input must be a bytes object containing bytes that
        were passed to decode() that have not yet been converted.
        additional_state_info must be a non-negative integer
        representing the state of the decoder WITHOUT yet having
        processed the contents of buffered_input.  In the initial state
        and after reset(), getstate() must return (b"", 0).
        )r?rrIrEs r>rbzIncrementalDecoder.getstates	���xr?c��dS)z�
        Set the current state of the decoder.

        state must have been returned by getstate().  The effect of
        setstate((b"", 0)) must be equivalent to reset().
        NrIrds  r>rfzIncrementalDecoder.setstate'r`r?NrSrg)	rGrBrCrHrYr%r_rbrfrIr?r>rr�ss��������
����"�"�"�"����
�������r?rc�:�eZdZdZdd�Zd�Zdd�Zd�Zd�Zd	�Z	d
S)
�BufferedIncrementalDecoderz�
    This subclass of IncrementalDecoder can be used as the baseclass for an
    incremental decoder if the decoder must be able to handle incomplete
    byte sequences.
    rKc�J�t�||��d|_dS�Nr?)rrYrWrXs  r>rYz#BufferedIncrementalDecoder.__init__5s#���#�#�D�&�1�1�1�����r?c��t�r4rMrms    r>�_buffer_decodez)BufferedIncrementalDecoder._buffer_decode:ror?Fc�v�|j|z}|�||j|��\}}||d�|_|Sr4)rWr�rQrqs      r>r%z!BufferedIncrementalDecoder.decode?rur?c�H�t�|��d|_dSr�)rr_rWrEs r>r_z BufferedIncrementalDecoder.resetGs!��� � ��&�&�&�����r?c��|jdfSrxryrEs r>rbz#BufferedIncrementalDecoder.getstateKs����Q��r?c� �|d|_dSrxryrds  r>rfz#BufferedIncrementalDecoder.setstateOs���A�h����r?NrSrg)
rGrBrCrHrYr�r%r_rbrfrIr?r>r�r�/s���������
����
"�"�"�
������� � � �����r?r�c�L�eZdZd
d�Zd�Zd�Zd�Zdd�Zefd�Z	d	�Z
d
�Zd�ZdS)rrKc�"�||_||_dS)aw Creates a StreamWriter instance.

            stream must be a file-like object open for writing.

            The StreamWriter may use different error handling
            schemes by providing the errors keyword argument. These
            parameters are predefined:

             'strict' - raise a ValueError (or a subclass)
             'ignore' - ignore the character and continue with the next
             'replace'- replace with a suitable replacement character
             'xmlcharrefreplace' - Replace with the appropriate XML
                                   character reference.
             'backslashreplace'  - Replace with backslashed escape
                                   sequences.
             'namereplace'       - Replace with \N{...} escape sequences.

            The set of allowed parameter values can be extended via
            register_error.
        N)�streamrQ�r=r�rQs   r>rYzStreamWriter.__init__\s��,�������r?c�v�|�||j��\}}|j�|��dS)z> Writes the object's contents encoded to self.stream.
        N)r$rQr��write)r=�objectrrrts    r>r�zStreamWriter.writeus9�����V�T�[�9�9���h�����$�����r?c�V�|�d�|����dS)z[ Writes the concatenated list of strings to the stream
            using .write().
        rVN)r��join�r=�lists  r>�
writelineszStreamWriter.writelines|s&��
	
�
�
�2�7�7�4�=�=�!�!�!�!�!r?c��dS)a2 Resets the codec buffers used for keeping internal state.

            Calling this method should ensure that the data on the
            output is put into a clean state, that allows appending
            of new fresh data without having to rescan the whole
            stream to recover state.

        NrIrEs r>r_zStreamWriter.reset�s	��	
�r?rc��|j�||��|dkr|dkr|���dSdSdSrx�r��seekr_�r=�offset�whences   r>r�zStreamWriter.seek�sG��������(�(�(��Q�;�;�6�Q�;�;��J�J�L�L�L�L�L��;�;�;r?c�$�||j|��S�z? Inherit all other methods from the underlying stream.
        �r��r=r7�getattrs   r>�__getattr__zStreamWriter.__getattr__����
�w�t�{�D�)�)�)r?c��|Sr4rIrEs r>�	__enter__zStreamWriter.__enter__�����r?c�8�|j���dSr4�r��close�r=�type�value�tbs    r>�__exit__zStreamWriter.__exit__������������r?c�:�td|jjz����Nzcan't serialize %s��	TypeErrorrArG�r=�protos  r>�
__reduce_ex__zStreamWriter.__reduce_ex__�����,�t�~�/F�F�G�G�Gr?NrS�r)
rGrBrCrYr�r�r_r�r�r�r�r�r�rIr?r>rrZs�����������2 � � �"�"�"�

�

�

�����$�*�*�*�*�������H�H�H�H�Hr?rc�p�eZdZeZdd�Zdd�Zdd�Zdd	�Zdd
�Z	d�Z
dd
�Zd�Zd�Z
efd�Zd�Zd�Zd�ZdS)rrKc��||_||_d|_|���|_|j|_d|_dS)a� Creates a StreamReader instance.

            stream must be a file-like object open for reading.

            The StreamReader may use different error handling
            schemes by providing the errors keyword argument. These
            parameters are predefined:

             'strict' - raise a ValueError (or a subclass)
             'ignore' - ignore the character and continue with the next
             'replace'- replace with a suitable replacement character
             'backslashreplace' - Replace with backslashed escape sequences;

            The set of allowed parameter values can be extended via
            register_error.
        r?N)r�rQ�
bytebuffer�charbuffertype�_empty_charbuffer�
charbuffer�
linebufferr�s   r>rYzStreamReader.__init__�sB��$���������!%�!4�!4�!6�!6����0�������r?c��t�r4rMrOs   r>r%zStreamReader.decode�s��!�!r?���Fc�*�|jr+|j�|j��|_d|_|dkr|}	|dkrt	|j��|krn�|dkr|j���}n|j�|��}|j|z}|sn�	|�||j	��\}}np#t$rc}|rV|�|d|j�|j	��\}}|�d���}	t	|	��dkr�n�Yd}~nd}~wwxYw||d�|_|xj|z
c_|sn��|dkr|j}
|j|_n#|jd|�}
|j|d�|_|
S)a� Decodes data from the stream self.stream and returns the
            resulting object.

            chars indicates the number of decoded code points or bytes to
            return. read() will never return more data than requested,
            but it might return less, if there is not enough available.

            size indicates the approximate maximum number of decoded
            bytes or code points to read for decoding. The decoder
            can modify this setting as appropriate. The default value
            -1 indicates to read and decode as much as possible.  size
            is intended to prevent having to decode huge files in one
            step.

            If firstline is true, and a UnicodeDecodeError happens
            after the first line terminator in the input only the first line
            will be returned, the rest of the input will be kept until the
            next call to read().

            The method should use a greedy read strategy, meaning that
            it should read as much data as is allowed within the
            definition of the encoding and the given size, e.g.  if
            optional encoding endings or state markers are available
            on the stream, these should be read too.
        NrT��keepends�)
r�r�r�r��lenr��readr�r%rQ�UnicodeDecodeError�start�
splitlines)r=�size�chars�	firstline�newdatarr�newchars�decodedbytes�exc�linesrss           r>r�zStreamReader.read�s���8�?�	#�"�4�9�9�$�/�J�J�D�O�"�D�O��1�9�9��E�	���z�z��t��'�'�5�0�0���a�x�x��+�*�*�,�,����+�*�*�4�0�0���?�W�,�D��
��

�)-���T�4�;�)G�)G�&��,�,��%�
�
�
������D��#�)��$4�d�k�B�B�+�H�l�$�/�/��/�>�>�E��5�z�z�1�}�}��%��%�}�}�}�}�����
����#�<�=�=�1�D�O��O�O�x�'�O�O��
��?	�@�1�9�9��_�F�"�4�D�O�O��_�V�e�V�,�F�"�o�e�f�f�5�D�O��
s�#C�
D/�AD*�*D/NTc��|jrf|jd}|jd=t|j��dkr|jd|_d|_|s|�d���d}|S|pd}|j}	|�|d���}|rnt
|t��r|�d	��s*t
|t��r/|�d
��r||�dd���z
}||z
}|�d���}|r�t|��dkrv|d}|d=t|��dkr$|dxx|jz
cc<||_d|_n|d|jz|_|s|�d���d}n�|d}|d�d���d}||kr7|j�
|dd���|jz|_|r|}n|}n2|r|�!|r|s|�d���d}n
|d
kr|dz}���|S)z� Read one line from the input stream and return the
            decoded data.

            size, if given, is passed as size argument to the
            read() method.

        rr�NFr��HT)r��
�
)r�r�r�i@�)r�r�r�r�r�r��
isinstance�str�endswith�bytesr�)	r=r�r��line�readsizerrr��line0withend�line0withoutends	         r>�readlinezStreamReader.readlines����?�
	��?�1�%�D����"��4�?�#�#�q�(�(�#'�/�!�"4���"&����
:������6�6�q�9���K��:�2���%��.	��9�9�X��9�6�6�D��
7��t�S�)�)�7�d�m�m�D�.A�.A�7��t�U�+�+�7�04�
�
�e�0D�0D�7��D�I�I�1�A�I�6�6�6�D��D�L�D��O�O�T�O�2�2�E��
��u�:�:��>�>�!��8�D��a���5�z�z�A�~�~��b�	�	�	�T�_�4�	�	�	�*/���*.����+0��(�T�_�*D���#�B�#�����>�>�q�A���$�Q�x��"'��(�"5�"5�u�"5�"E�"E�a�"H���?�2�2�&*�&<�&A�&A�%����)�&L�&L�&*�o�'6�D�O��/�+���.����
�4�+��>��>��?�?�E�?�:�:�1�=�D���$����A�
��].	�^�r?c�T�|���}|�|��S)aS Read all lines available on the input stream
            and return them as a list.

            Line breaks are implemented using the codec's decoder
            method and are included in the list entries.

            sizehint, if given, is ignored since there is no efficient
            way to finding the true end-of-line.

        )r�r�)r=�sizehintr�rrs    r>�	readlineszStreamReader.readlinesas#���y�y�{�{�����x�(�(�(r?c�:�d|_|j|_d|_dS)z� Resets the codec buffers used for keeping internal state.

            Note that no stream repositioning should take place.
            This method is primarily intended to be able to recover
            from decoding errors.

        r?N)r�r�r�r�rEs r>r_zStreamReader.resetps ������0�������r?rc�d�|j�||��|���dS)zp Set the input stream's current position.

            Resets the codec buffers used for keeping state.
        Nr�r�s   r>r�zStreamReader.seek}s-��
	
������(�(�(��
�
�����r?c�@�|���}|r|St��z4 Return the next decoded line from the input stream.)r��
StopIteration)r=r�s  r>�__next__zStreamReader.__next__�s$���}�}�����	��K��r?c��|Sr4rIrEs r>�__iter__zStreamReader.__iter__�r�r?c�$�||j|��Sr�r�r�s   r>r�zStreamReader.__getattr__�r�r?c��|Sr4rIrEs r>r�zStreamReader.__enter__�r�r?c�8�|j���dSr4r�r�s    r>r�zStreamReader.__exit__�r�r?c�:�td|jjz���r�r�r�s  r>r�zStreamReader.__reduce_ex__�r�r?rS)r�r�F)NTr�)rGrBrCr�r�rYr%r�r�r�r_r�r�r�r�r�r�r�r�rIr?r>rr�s�������N�����2"�"�"�"�N�N�N�N�`I�I�I�I�V
)�
)�
)�
)��������������$�*�*�*�*�������H�H�H�H�Hr?rc�x�eZdZdZdZdd�Zdd�Zdd�Zdd	�Zd
�Z	d�Z
d�Zd
�Zd�Z
dd�Zefd�Zd�Zd�Zd�ZdS)ra StreamReaderWriter instances allow wrapping streams which
        work in both read and write modes.

        The design is such that one can use the factory functions
        returned by the codec.lookup() function to construct the
        instance.

    �unknownrKc�f�||_|||��|_|||��|_||_dS)aR Creates a StreamReaderWriter instance.

            stream must be a Stream-like object.

            Reader, Writer must be factory functions or classes
            providing the StreamReader, StreamWriter interface resp.

            Error handling is done in the same way as defined for the
            StreamWriter/Readers.

        N)r��reader�writerrQ)r=r��Reader�WriterrQs     r>rYzStreamReaderWriter.__init__�s<������f�V�V�,�,����f�V�V�,�,�������r?r�c�6�|j�|��Sr4)r�r��r=r�s  r>r�zStreamReaderWriter.read�s���{����%�%�%r?Nc�6�|j�|��Sr4)r�r�r�s  r>r�zStreamReaderWriter.readline�s���{�#�#�D�)�)�)r?c�6�|j�|��Sr4)r�r�)r=r�s  r>r�zStreamReaderWriter.readlines�s���{�$�$�X�.�.�.r?c�*�t|j��Sr�)�nextr�rEs r>r�zStreamReaderWriter.__next__�s���D�K� � � r?c��|Sr4rIrEs r>r�zStreamReaderWriter.__iter__�r�r?c�6�|j�|��Sr4)r�r�)r=rrs  r>r�zStreamReaderWriter.write�s���{� � ��&�&�&r?c�6�|j�|��Sr4)r�r�r�s  r>r�zStreamReaderWriter.writelines�s���{�%�%�d�+�+�+r?c�j�|j���|j���dSr4�r�r_r�rEs r>r_zStreamReaderWriter.reset��0�����������������r?rc��|j�||��|j���|dkr!|dkr|j���dSdSdSrx)r�r�r�r_r�r�s   r>r�zStreamReaderWriter.seek�sd��������(�(�(���������Q�;�;�6�Q�;�;��K���������;�;�;r?c�$�||j|��Sr�r�r�s   r>r�zStreamReaderWriter.__getattr__�r�r?c��|Sr4rIrEs r>r�zStreamReaderWriter.__enter__�r�r?c�8�|j���dSr4r�r�s    r>r�zStreamReaderWriter.__exit__�r�r?c�:�td|jjz���r�r�r�s  r>r�z StreamReaderWriter.__reduce_ex__�r�r?rS�r�r4r�)rGrBrCrH�encodingrYr�r�r�r�r�r�r�r_r�r�r�r�r�r�rIr?r>rr�s���������H�����$&�&�&�&�*�*�*�*�/�/�/�/�!�!�!�
���'�'�'�,�,�,����
 � � � �$�*�*�*�*�������H�H�H�H�Hr?rc�~�eZdZdZdZdZ	dd�Zdd�Zdd�Zdd	�Z	d
�Z
d�Zd�Zd
�Z
d�Zdd�Zefd�Zd�Zd�Zd�ZdS)raB StreamRecoder instances translate data from one encoding to another.

        They use the complete set of APIs returned by the
        codecs.lookup() function to implement their task.

        Data written to the StreamRecoder is first decoded into an
        intermediate format (depending on the "decode" codec) and then
        written to the underlying stream using an instance of the provided
        Writer class.

        In the other direction, data is read from the underlying stream using
        a Reader instance and then encoded and returned to the caller.

    r�rKc��||_||_||_|||��|_|||��|_||_dS)a� Creates a StreamRecoder instance which implements a two-way
            conversion: encode and decode work on the frontend (the
            data visible to .read() and .write()) while Reader and Writer
            work on the backend (the data in stream).

            You can use these objects to do transparent
            transcodings from e.g. latin-1 to utf-8 and back.

            stream must be a file-like object.

            encode and decode must adhere to the Codec interface; Reader and
            Writer must be factory functions or classes providing the
            StreamReader and StreamWriter interfaces resp.

            Error handling is done in the same way as defined for the
            StreamWriter/Readers.

        N)r�r$r%r�r�rQ)r=r�r$r%r�r�rQs       r>rYzStreamRecoder.__init__sJ��*����������f�V�V�,�,����f�V�V�,�,�������r?r�c�v�|j�|��}|�||j��\}}|Sr4)r�r�r$rQ�r=r�rr�bytesencodeds    r>r�zStreamRecoder.read,s6���{����%�%��!�[�[��t�{�;�;���l��r?Nc��|�|j���}n|j�|��}|�||j��\}}|Sr4)r�r�r$rQrs    r>r�zStreamRecoder.readline2sP���<��;�'�'�)�)�D�D��;�'�'��-�-�D�!�[�[��t�{�;�;���l��r?c��|j���}|�||j��\}}|�d���S)NTr�)r�r�r$rQr�)r=r�rrrs    r>r�zStreamRecoder.readlines;sC���{���!�!��!�[�[��t�{�;�;���l������-�-�-r?c�j�t|j��}|�||j��\}}|Sr�)r�r�r$rQ)r=rrrs   r>r�zStreamRecoder.__next__As2���D�K� � ��!�[�[��t�{�;�;���l��r?c��|Sr4rIrEs r>r�zStreamRecoder.__iter__Hr�r?c�r�|�||j��\}}|j�|��Sr4)r%rQr�r�)r=rr�bytesdecodeds   r>r�zStreamRecoder.writeKs2��!�[�[��t�{�;�;���l��{� � ��&�&�&r?c��d�|��}|�||j��\}}|j�|��Sr�)r�r%rQr�r�)r=r�rrrs    r>r�zStreamRecoder.writelinesPsA���x�x��~�~��!�[�[��t�{�;�;���l��{� � ��&�&�&r?c�j�|j���|j���dSr4rrEs r>r_zStreamRecoder.resetVrr?rc�r�|j�||��|j�||��dSr4)r�r�r�r�s   r>r�zStreamRecoder.seek[s:��	
������(�(�(�������(�(�(�(�(r?c�$�||j|��Sr�r�r�s   r>r�zStreamRecoder.__getattr__ar�r?c��|Sr4rIrEs r>r�zStreamRecoder.__enter__hr�r?c�8�|j���dSr4r�r�s    r>r�zStreamRecoder.__exit__kr�r?c�:�td|jjz���r�r�r�s  r>r�zStreamRecoder.__reduce_ex__nr�r?rSr	r4r�)rGrBrCrH�
data_encoding�
file_encodingrYr�r�r�r�r�r�r�r_r�r�r�r�r�r�rIr?r>rr�s)������
�
��M��M�!�����8��������.�.�.�.�������'�'�'�
'�'�'����
)�)�)�)�$�*�*�*�*�������H�H�H�H�Hr?r�rrKr�c���|�	d|vr|dz}tj|||��}|�|S	t|��}t||j|j|��}||_|S#|����xYw)a� Open an encoded file using the given mode and return
        a wrapped version providing transparent encoding/decoding.

        Note: The wrapped version will only accept the object format
        defined by the codecs, i.e. Unicode objects for most builtin
        codecs. Output is also codec dependent and will usually be
        Unicode as well.

        If encoding is not None, then the
        underlying encoded files are always opened in binary mode.
        The default file mode is 'r', meaning to open the file in read mode.

        encoding specifies the encoding which is to be used for the
        file.

        errors may be given to define the error handling. It defaults
        to 'strict' which causes ValueErrors to be raised in case an
        encoding error occurs.

        buffering has the same meaning as for the builtin open() API.
        It defaults to -1 which means that the default buffer size will
        be used.

        The returned wrapped file object provides an extra attribute
        .encoding which allows querying the used encoding. This
        attribute is only available if an encoding was specified as
        parameter.

    N�b)�builtinsrrrr;r:r
r�)�filename�moder
rQ�	buffering�file�info�srws        r>rrss���>��
�$����c�z���=��4��3�3�D�������h���� ��t�'8�$�:K�V�T�T������
����
�
����
���s�3A�A2c��|�|}t|��}t|��}t||j|j|j|j|��}||_||_|S)a� Return a wrapped version of file which provides transparent
        encoding translation.

        Data written to the wrapped file is decoded according
        to the given data_encoding and then encoded to the underlying
        file using file_encoding. The intermediate data type
        will usually be Unicode but depends on the specified codecs.

        Bytes read from the file are decoded using file_encoding and then
        passed back to the caller encoded using data_encoding.

        If file_encoding is not given, it defaults to data_encoding.

        errors may be given to define the error handling. It defaults
        to 'strict' which causes ValueErrors to be raised in case an
        encoding error occurs.

        The returned wrapped file object provides two extra attributes
        .data_encoding and .file_encoding which reflect the given
        parameters of the same name. The attributes can be used for
        introspection by Python programs.

    )rrr$r%r;r:rr)r&rrrQ�	data_info�	file_info�srs       r>rr�sj��2��%�
��}�%�%�I��}�%�%�I�	�t�Y�-�y�/?� �-�y�/E�v�
O�
O�B�%�B��$�B��
�Ir?c�*�t|��jS)z� Lookup up the codec for the given encoding and return
        its encoder function.

        Raises a LookupError in case the encoding cannot be found.

    )rr$�r
s r>rr�����(���"�"r?c�*�t|��jS)z� Lookup up the codec for the given encoding and return
        its decoder function.

        Raises a LookupError in case the encoding cannot be found.

    )rr%r.s r>rr�r/r?c�P�t|��j}|�t|���|S)z� Lookup up the codec for the given encoding and return
        its IncrementalEncoder class or factory function.

        Raises a LookupError in case the encoding cannot be found
        or the codecs doesn't provide an incremental encoder.

    )rr8�LookupError)r
�encoders  r>r r ��,���X���1�G����(�#�#�#��Nr?c�P�t|��j}|�t|���|S)z� Lookup up the codec for the given encoding and return
        its IncrementalDecoder class or factory function.

        Raises a LookupError in case the encoding cannot be found
        or the codecs doesn't provide an incremental decoder.

    )rr9r2)r
�decoders  r>r!r!�r4r?c�*�t|��jS)z� Lookup up the codec for the given encoding and return
        its StreamReader class or factory function.

        Raises a LookupError in case the encoding cannot be found.

    )rr;r.s r>r"r"�����(���(�(r?c�*�t|��jS)z� Lookup up the codec for the given encoding and return
        its StreamWriter class or factory function.

        Raises a LookupError in case the encoding cannot be found.

    )rr:r.s r>r#r#r8r?c+�K�t|��|fi|��}|D]}|�|��}|r|V��|�dd��}|r|V�dSdS)z�
    Encoding iterator.

    Encodes the input strings from the iterator using an IncrementalEncoder.

    errors and kwargs are passed through to the IncrementalEncoder
    constructor.
    rVTN)r r$)�iteratorr
rQ�kwargsr3rP�outputs       r>r&r&s�����.�#�H�-�-�f�?�?��?�?�G���������&�&���	��L�L�L��
�^�^�B��
%�
%�F�
���������r?c+�K�t|��|fi|��}|D]}|�|��}|r|V��|�dd��}|r|V�dSdS)z�
    Decoding iterator.

    Decodes the input strings from the iterator using an IncrementalDecoder.

    errors and kwargs are passed through to the IncrementalDecoder
    constructor.
    r?TN)r!r%)r;r
rQr<r6rPr=s       r>r'r' s�����.�#�H�-�-�f�?�?��?�?�G���������&�&���	��L�L�L��
�^�^�C��
&�
&�F�
���������r?c��d�|D��S)z� make_identity_dict(rng) -> dict

        Return a dictionary where elements of the rng sequence are
        mapped to themselves.

    c��i|]}||��SrIrI)�.0�is  r>�
<dictcomp>z&make_identity_dict.<locals>.<dictcomp><s�����A�A�a���r?rI)�rngs r>�make_identity_dictrE4s��������r?c�\�i}|���D]\}}||vr|||<�d||<�|S)a� Creates an encoding map from a decoding map.

        If a target mapping in the decoding map occurs multiple
        times, then that target is mapped to None (undefined mapping),
        causing an exception when encountered by the charmap codec
        during translation.

        One example where this happens is cp875.py which decodes
        multiple character to \u001a.

    N)�items)�decoding_map�m�k�vs    r>�make_encoding_maprL>sL��	�A��!�!�#�#�����!��A�v�v��A�a�D�D��A�a�D�D��Hr?�ignore�replace�xmlcharrefreplace�backslashreplace�namereplace�__main__zlatin-1zutf-8)rNrKr�)NrKrS)<rHr"�sys�_codecs�ImportError�why�SystemError�__all__rr
rr	rrr�	byteorderrrrrrrr
r5rrr�rrirr�rrrrrrrrr r!r"r#r&r'rErLr/r(r)r*r+r,r-r2�_false�	encodingsrG�stdout�stdinrIr?r>�<module>r^s���������
�
�
�
�E��������E�E�E�
�+�=��C�
D�
D�D�����E����
-�
-�
-��0��$�#���$�#���#��#���=�H���#�"�C�)��I�I�
#�"�C�)��I���������
&�&�&�&�&��&�&�&�>@"�@"�@"�@"�@"�@"�@"�@"�D&�&�&�&�&��&�&�&�P "� "� "� "� "�!3� "� "� "�D/�/�/�/�/��/�/�/�b"�"�"�"�"�!3�"�"�"�VHH�HH�HH�HH�HH�5�HH�HH�HH�XxH�xH�xH�xH�xH�5�xH�xH�xH�xVH�VH�VH�VH�VH�VH�VH�VH�tsH�sH�sH�sH�sH�sH�sH�sH�n/�/�/�/�b"�"�"�"�L#�#�#�#�#�#�������)�)�)�)�)�)�����$����(���
�
�
�.� �L��*�*�M� �L��*�*�M�!�\�)�,�,�N�+�|�,?�@�@��*�l�+=�>�>��%��m�4�4���������M��M��N�#��"����������
��	�������z�����S�Z��G�<�<�C�J���C�I�w�	�:�:�C�I�I�I�
�s#��)�$�)�AE�E'�&E'

Zerion Mini Shell 1.0