Your IP : 18.226.28.97


Current Path : /opt/alt/python310/lib64/python3.10/encodings/__pycache__/
Upload File :
Current File : //opt/alt/python310/lib64/python3.10/encodings/__pycache__/idna.cpython-310.opt-1.pyc

o

6��f�#�@s�ddlZddlZddlZddlmZe�d�ZdZdZdd�Z	dd	�Z
d
d�ZGdd
�d
ej�ZGdd�dej
�ZGdd�dej�ZGdd�deej�ZGdd�deej�Zdd�ZdS)�N)�	ucd_3_2_0u[.。.。]sxn--zxn--cCs�g}|D]}t�|�rq|�t�|��qd�|�}t�d|�}|D]5}t�|�sQt�|�sQt�	|�sQt�
|�sQt�|�sQt�|�sQt�
|�sQt�|�sQt�|�rWtd|��q"dd�|D�}t|�r|tdd�|D��rptd��|d	rx|d
s|td��|S)N�ZNFKCzInvalid character %rcSsg|]}t�|��qS�)�
stringprepZin_table_d1��.0�xrr�5/opt/alt/python310/lib64/python3.10/encodings/idna.py�
<listcomp>)sznameprep.<locals>.<listcomp>css�|]}t�|�VqdS)N)rZin_table_d2rrrr	�	<genexpr>1s�znameprep.<locals>.<genexpr>zViolation of BIDI requirement 2r���zViolation of BIDI requirement 3)rZin_table_b1�appendZmap_table_b2�join�unicodedataZ	normalizeZin_table_c12Zin_table_c22Zin_table_c3Zin_table_c4Zin_table_c5Zin_table_c6Zin_table_c7Zin_table_c8Zin_table_c9�UnicodeError�any)�labelZnewlabel�cZRandALrrr	�nameprepsD


��������	�rcCs�z|�d�}Wn	tyYnwdt|�krdkr#|Std��td��t|�}z|�d�}Wn	ty;Ynwdt|�krIdkrN|Std��td��|�t�r[td��|�d�}t|}dt|�krqdkrv|Std��td��)N�asciir�@�label empty or too longzLabel starts with ACE prefix�punycode)�encoder�lenr�
startswith�sace_prefix�
ace_prefix)rrrr	�ToASCII<s6����

�rcCs�t|t�rd}nz	|�d�}d}Wntyd}Ynw|s6t|�}z|�d�}Wnty5td��w|�t�s@t|d�S|tt�d�}|�	d�}t
|�}t|d���t|d�krctd||��|S)NTrFzInvalid character in IDN labelrzIDNA does not round-trip)�
isinstance�bytesrrrrr�strr�decoder�lower)rZ
pure_asciiZlabel1�resultZlabel2rrr	�	ToUnicodegs.

��


r%c@s eZdZddd�Zddd�ZdS)�Codec�strictcCs|dkr
td|��|sdSz|�d�}Wn	tyYn5w|�d�}|dd�D]}dt|�kr;dks@td	��td	��q*t|d�dkrMtd
��|t|�fSt�}t�|�}|rg|dsgd}|d=nd}|D]}|rt|�d�|�t|��qkt	||�t|�fS)Nr'�unsupported error handling ��rr�.rrrrzlabel too longr*)
rr�UnicodeEncodeError�splitr�	bytearray�dots�extendrr )�self�input�errorsr$�labelsr�trailing_dotrrr	r�s<�
��

zCodec.encodecCs�|dkr
td|��|sdSt|t�st|�}t|vr/z
|�d�t|�fWSty.Ynw|�d�}|rDt|d�dkrDd}|d=nd	}g}|D]	}|�t	|��qJd�
|�|t|�fS)
Nr'�Unsupported error handling �rrrr+rr�.r)rrr rr"r�UnicodeDecodeErrorr-r
r%r)r1r2r3r4r5r$rrrr	r"�s*
�
zCodec.decodeN)r')�__name__�
__module__�__qualname__rr"rrrr	r&�s
%r&c@�eZdZdd�ZdS)�IncrementalEncoderc	Cs�|dkr
td|��|sdSt�|�}d}|r*|ds!d}|d=n	|s*|d=|r*d}t�}d}|D]}|r>|�d�|d7}|�t|��|t|�7}q1||7}|t|�7}t|�|fS)	Nr'r(r)r*rr+r�)rr/r-r.r0rrr �	r1r2r3�finalr4r5r$�sizerrrr	�_buffer_encode�s2

z!IncrementalEncoder._buffer_encodeN)r:r;r<rCrrrr	r>��r>c@r=)�IncrementalDecoderc	Cs�|dkr
td|��|sdSt|t�rt�|�}n
t|d�}|�d�}d}|r:|ds1d}|d=n	|s:|d=|r:d}g}d}|D]}|�t|��|rO|d	7}|t|�7}q@d�|�|}|t|�7}||fS)
Nr'r6r7rr8rrrr?)	rrr!r/r-r
r%rrr@rrr	�_buffer_decode�s6


z!IncrementalDecoder._buffer_decodeN)r:r;r<rFrrrr	rE�rDrEc@�eZdZdS)�StreamWriterN�r:r;r<rrrr	rH"�rHc@rG)�StreamReaderNrIrrrr	rK%rJrKc	Cs tjdt�jt�jttttd�S)NZidna)�namerr"�incrementalencoder�incrementaldecoder�streamwriter�streamreader)	�codecs�	CodecInfor&rr"r>rErHrKrrrr	�getregentry*s�rS)r�rerQrr�compiler/rrrrr%r&�BufferedIncrementalEncoderr>�BufferedIncrementalDecoderrErHrKrSrrrr	�<module>s
.+)H#'

?>