Your IP : 3.143.212.252
U
i�f�#�@s�ddlZddlZddlZddlmZe�d�ZdZdZdd�Z dd �Z
d
d�ZGdd
�d
ej�ZGdd�dej
�ZGdd�dej�ZGdd�deej�ZGdd�deej�Zdd�ZdS)�N)� ucd_3_2_0u[.。.。]sxn--zxn--cCs�g}|D] }t�|�rq|�t�|��qd�|�}t�d|�}|D]j}t�|�s�t�|�s�t� |�s�t�
|�s�t�|�s�t�|�s�t�
|�s�t�|�s�t�|�rDtd|��qDdd�|D�}t|�r�tdd�|D��r�td��|d r�|d
s�td��|S)N�ZNFKCzInvalid character %rcSsg|]}t�|��qS�)�
stringprepZin_table_d1��.0�xrr�3/opt/alt/python38/lib64/python3.8/encodings/idna.py�
<listcomp>)sznameprep.<locals>.<listcomp>css|]}t�|�VqdS)N)rZin_table_d2rrrr � <genexpr>1sznameprep.<locals>.<genexpr>zViolation of BIDI requirement 2r���zViolation of BIDI requirement 3)rZin_table_b1�appendZmap_table_b2�join�unicodedataZ normalizeZin_table_c12Zin_table_c22Zin_table_c3Zin_table_c4Zin_table_c5Zin_table_c6Zin_table_c7Zin_table_c8Zin_table_c9�UnicodeError�any)�labelZnewlabel�cZRandALrrr �nameprepsB
�������� rcCs�z|�d�}Wntk
r"Yn*Xdt|�kr<dkrDnn|Std��t|�}z|�d�}Wntk
rvYn*Xdt|�kr�dkr�nn|Std��|�t�r�td��|�d�}t|}dt|�kr�dkr�nn|Std��dS)N�asciir�@�label empty or too longzLabel starts with ACE prefix�punycode)�encoder�lenr�
startswith�sace_prefix�
ace_prefix)rrrr �ToASCII<s,
rcCs�t|t�rd}n,z|�d�}d}Wntk
r:d}YnX|stt|�}z|�d�}Wntk
rrtd��YnX|�t�s�t|d�S|tt�d�}|� d�}t
|�}t|d���t|d�kr�td||��|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|dkrtd|��|sdSz|�d�}Wntk
r>YndX|�d�}|dd�D]&}dt|�krrdksVntd ��qVt|d�dkr�td
��|t|�fSt�}t�|�}|r�|ds�d}|d=nd}|D] }|r�|�d�|�t|��q�t ||�t|�fS)Nr'�unsupported error handling ��rr�.rrrrzlabel too longr*)
rr�UnicodeEncodeError�splitr� bytearray�dots�extendrr )�self�input�errorsr$�labelsr�trailing_dotrrr r�s4
zCodec.encodecCs�|dkrtd|��|sdSt|t�s.t|�}t|kr`z|�d�t|�fWStk
r^YnX|�d�}|r�t|d�dkr�d}|d=nd }g}|D]}|�t |��q�d�
|�|t|�fS)
Nr'�Unsupported error handling �rrrr+rr�.r)rrr rr"r�UnicodeDecodeErrorr-r
r%r)r1r2r3r4r5r$rrrr r"�s(
zCodec.decodeN)r')r')�__name__�
__module__�__qualname__rr"rrrr r&�s
%r&c@seZdZdd�ZdS)�IncrementalEncoderc Cs�|dkrtd|��|sdSt�|�}d}|rT|dsBd}|d=n|sT|d=|rTd}t�}d}|D]4}|r||�d�|d7}|�t|��|t|�7}qb||7}|t|�7}t|�|fS) Nr'r(r)r*rr+r�)rr/r-r.r0rrr � r1r2r3�finalr4r5r$�sizerrrr �_buffer_encode�s2
z!IncrementalEncoder._buffer_encodeN)r:r;r<rBrrrr r=�sr=c@seZdZdd�ZdS)�IncrementalDecoderc Cs�|dkrtd|��|sdSt|t�r2t�|�}nt|d�}|�d�}d}|rt|dsbd}|d=n|st|d=|rtd}g}d}|D]*}|�t|��|r�|d 7}|t|�7}q�d�|�|}|t|�7}||fS)
Nr'r6r7rr8rrrr>) rrr!r/r-r
r%rrr?rrr �_buffer_decode�s6
z!IncrementalDecoder._buffer_decodeN)r:r;r<rDrrrr rC�srCc@seZdZdS)�StreamWriterN�r:r;r<rrrr rE"srEc@seZdZdS)�StreamReaderNrFrrrr rG%srGc Cs tjdt�jt�jttttd�S)NZidna)�namerr"�incrementalencoder�incrementaldecoder�streamwriter�streamreader) �codecs� CodecInfor&rr"r=rCrErGrrrr �getregentry*s�rO)r�rerMrr�compiler/rrrrr%r&�BufferedIncrementalEncoderr=�BufferedIncrementalDecoderrCrErGrOrrrr �<module>s
.+)H#'
?>