%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /snap/certbot/5911/lib64/python3.12/site-packages/idna/__pycache__/
Upload File :
Create Path :
Current File : //snap/certbot/5911/lib64/python3.12/site-packages/idna/__pycache__/codec.cpython-312.pyc

�

�h�jB��J�ddlmZddlZddlmZddlmZmZmZm	Z	m
Z
mZmZGd�dej�Z
Gd�d	ej�ZGd
�dej �ZGd�d
e
ej$�ZGd�de
ej&�Zdd�Zej*e�y)�)�annotationsN)�Any�)�	IDNAError�_max_domain_length�_unicode_dots_re�alabel�decode�encode�ulabelc�$�eZdZdZddd�Zddd�Zy)�CodecafStateless IDNA 2008 codec.

    Implements the :class:`codecs.Codec` protocol so that the whole-domain
    encoder (:func:`idna.encode`) and decoder (:func:`idna.decode`) are
    accessible through the standard codec machinery as ``"idna2008"``.

    Only the ``"strict"`` error handler is supported; any other handler
    raises :exc:`~idna.IDNAError`.
    c�`�|dk7rtd|�d�d���|syt|�t|�fS)N�strict�Unsupported error handling "�"�unsupported_errors��code)�r)rr�len��self�data�errorss   �F/root/parts/certbot/install/lib/python3.12/site-packages/idna/codec.pyrzCodec.encodes;���X���:�6�(�!�D�K_�`�`����d�|�S��Y�&�&rc�`�|dk7rtd|�d�d���|syt|�t|�fS)Nrrrrr��r)rr
rrs   rr
zCodec.decodes;���X���:�6�(�!�D�K_�`�`����d�|�S��Y�&�&rN�r)r�strrr!�return�tuple[bytes, int])r�bytesrr!r"�tuple[str, int])�__name__�
__module__�__qualname__�__doc__rr
�rrrr	s���'�'rrc�J��eZdZdZdd�fd�
Zd	�fd�Zd
d�Zdd�Zdd�Z�xZ	S)
�IncrementalEncodera�Incremental IDNA 2008 encoder.

    Buffers a partial trailing label across calls until either the next
    label separator is seen or ``final=True``, so that streamed input is
    encoded one whole label at a time. Any of the four Unicode label
    separators (``U+002E``, ``U+3002``, ``U+FF0E``, ``U+FF61``) ends a
    label; the result always uses ``U+002E`` as the separator.

    The 253-octet domain length limit (254 with a trailing dot) that
    :func:`idna.encode` enforces is applied to the accumulated output, so
    that streaming a name and encoding it in one shot either both succeed
    with the same result or both raise :exc:`~idna.IDNAError`.

    Only the ``"strict"`` error handler is supported.
    c�@��t�|�|�d|_d|_y�NrF)�super�__init__�_emitted�
_trailing_dot�rr�	__class__s  �rr0zIncrementalEncoder.__init__8s���
���� ���
�"��rc�>��t�|��d|_d|_yr.)r/�resetr1r2�rr4s �rr6zIncrementalEncoder.reset=s���
��
����
�"��rc�z�|js
|jsy|j|j|jfS�Nr)�bufferr1r2�rs r�getstatezIncrementalEncoder.getstateBs-���{�{�4�=�=�����T�]�]�D�,>�,>�?�?rc�T�|r|\|_|_|_y|j�y�N)r:r1r2r6�r�states  r�setstatezIncrementalEncoder.setstateGs!���=B�:�D�K����(:��J�J�Lrc�$�|dk7rtd|�d�d���d}d}|r�tj|�}d}|r|dsd	}|d=n	|s|d=|rd	}g}|D]1}	|jt	|	��|r|d
z
}|t|	�z
}�3d	j
|�|z}|t|�z
}|xjt|�z
c_|r|jd	�|_	|jxs|}
|jt|
zkDr
tdd���||fS)
Nrrrrrrr����.r�Domain too long�domain_too_long)rr�split�appendr	r�joinr1�endswithr2r)rrr�final�result_bytes�size�labels�trailing_dot�result�label�may_end_with_dots           r�_buffer_encodez!IncrementalEncoder._buffer_encodeMs9���X���:�6�(�!�D�K_�`�`������%�+�+�D�1�F��L���b�z�#'�L��r�
���r�
��'+���F��
#���
�
�f�U�m�,���A�I�D���E�
�"��	
#� �9�9�V�,�|�;�L��C��%�%�D�
	
�
�
��\�*�*�
��!-�!6�!6�t�!<�D���-�-�:�U����=�=�-�0@�@�@��-�4E�F�F��T�!�!rr �rr!r"�None�r"rU)r"r)r@rr"rU)rr!rr!rK�boolr"r#)
r&r'r(r)r0r6r<rArS�
__classcell__�r4s@rr,r,'s"���� #�
#�
@�
�&"rr,c�J��eZdZdZdd�fd�
Zd	�fd�Zd
d�Zdd�Zdd�Z�xZ	S)
�IncrementalDecoderaIncremental IDNA 2008 decoder.

    Buffers a partial trailing label across calls until either the next
    label separator is seen or ``final=True``, so that streamed input is
    decoded one whole label at a time.

    The 254-octet input length limit that :func:`idna.decode` enforces is
    applied to the accumulated input, so that streaming a name and decoding
    it in one shot either both succeed with the same result or both raise
    :exc:`~idna.IDNAError`.

    Only the ``"strict"`` error handler is supported.
    c�2��t�|�|�d|_yr9)r/r0�	_consumedr3s  �rr0zIncrementalDecoder.__init__�s���
���� ���rc�0��t�|��d|_yr9)r/r6r]r7s �rr6zIncrementalDecoder.reset�s���
��
����rc�2�|j|jfSr>�r:r]r;s rr<zIncrementalDecoder.getstate�s�����T�^�^�,�,rc�"�|\|_|_yr>r`r?s  rrAzIncrementalDecoder.setstate�s��&+�#���T�^rc�N�|dk7rtd|�d�d���|syt|t�s
	t|d�}|jt|�ztd
zkDr
tdd���tj|�}d
}|r|dsd}|d=n	|s|d=|rd}g}d}|D]1}	|jt|	��|r|d
z
}|t|	�z
}�3dj|�|z}
|t|�z
}|xj|z
c_|
|fS#t$r}tdd	��|�d}~wwxYw)Nrrrrrr�asciizInvalid ASCII in A-label�
invalid_asciirrErFrrC�.r)r�
isinstancer!�UnicodeDecodeErrorr]rrrrGrHrrI)rrrrK�errrNrOrPrMrQ�
result_strs           r�_buffer_decodez!IncrementalDecoder._buffer_decode�sS���X���:�6�(�!�D�K_�`�`����$��$�
[��4��)���>�>�C��I�%�(:�Q�(>�>��-�4E�F�F�!�'�'��-������"�:�"���2�J���2�J��#&�L������	�E��M�M�&��-�(����	���C��J��D�		��X�X�f�%��4�
���L�!�!�����$����D�!�!��C&�
[�� :��Q�WZ�Z��
[�s�D�	D$�D�D$r rTrV)r"r#)r@r#r"rU)rrrr!rKrWr"r%)
r&r'r(r)r0r6r<rArjrXrYs@rr[r[vs!������-�,�+"rr[c��eZdZy)�StreamWriterN�r&r'r(r*rrrlrl����rrlc��eZdZy)�StreamReaderNrmr*rrrprp�rnrrpc	��|dk7rytj|t�jt�jt
ttt��S)a�Codec search function registered with :mod:`codecs`.

    Returns a :class:`codecs.CodecInfo` for the ``"idna2008"`` codec name
    so that ``str.encode("idna2008")`` and ``bytes.decode("idna2008")``
    invoke the IDNA 2008 codec defined in this module.

    :param name: The codec name being looked up.
    :returns: A :class:`codecs.CodecInfo` instance if ``name`` is
        ``"idna2008"``, otherwise ``None``.
    �idna2008N)�namerr
�incrementalencoder�incrementaldecoder�streamwriter�streamreader)	�codecs�	CodecInforrr
r,r[rlrp)rss r�search_functionrz�sC���z������
��w�~�~��w�~�~�-�-�!�!��r)rsr!r"zcodecs.CodecInfo | None)�
__future__rrx�typingr�corerrrr	r
rrr�BufferedIncrementalEncoderr,�BufferedIncrementalDecoderr[rlrprz�registerr*rr�<module>r�s���"�
��a�a�a�'�F�L�L�'�<L"��:�:�L"�^H"��:�:�H"�V	�5�&�-�-�	�	�5�&�-�-�	��0����� r

Zerion Mini Shell 1.0
GEPRES Tracking

República de Moçambique

Ministério da Economia e Finanças