Hacked By AnonymousFox

Current Path : /opt/alt/python37/lib64/python3.7/encodings/__pycache__/
Upload File :
Current File : //opt/alt/python37/lib64/python3.7/encodings/__pycache__/idna.cpython-37.opt-2.pyc

B

YI~d�#�@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--cCsg}x(|D] }t�|�rq
|�t�|��q
Wd�|�}t�d|�}xr|D]j}t�|�s�t�|�s�t�	|�s�t�
|�s�t�|�s�t�|�s�t�
|�s�t�|�s�t�|�rJtd|��qJWdd�|D�}t|��rtdd�|D��r�td��|d	r�|d
�std��|S)N�ZNFKCzInvalid character %rcSsg|]}t�|��qS�)�
stringprepZin_table_d1)�.0�xrr�3/opt/alt/python37/lib64/python3.7/encodings/idna.py�
<listcomp>)sznameprep.<locals>.<listcomp>css|]}t�|�VqdS)N)rZin_table_d2)rrrrr�	<genexpr>1sznameprep.<locals>.<genexpr>zViolation of BIDI requirement 2r���zViolation of BIDI requirement 3)rZin_table_b1�appendZmap_table_b2�join�unicodedata�	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�namepreps2













rcCs�y|�d�}Wntk
r"Yn*Xdt|�kr<dkrDnn|Std��t|�}y|�d�}Wntk
rvYn*Xdt|�kr�dkr�nn|Std��|�t�r�td��|�d�}t|}dt|�kr�dkr�nn|Std��dS)N�asciir�@zlabel empty or too longzLabel starts with ACE prefix�punycode)�encoder�lenr�
startswith�sace_prefix�
ace_prefix)rrrr�ToASCII<s,

rcCs�t|t�rd}n,y|�d�}d}Wntk
r:d}YnX|stt|�}y|�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|��|sdSy|�d�}Wntk
r>YnhX|�d�}x6|dd�D]&}dt|�krtdksXntd	��qXWt|d�dkr�td
��|t|�fSt�}t�|�}|r�|ds�d}|d=nd}x(|D] }|r�|�d�|�t|��q�Wt	||�t|�fS)Nr&zunsupported error handling )�rr�.rrrzlabel empty or too longzlabel too longr')
rr�UnicodeEncodeError�splitr�	bytearray�dots�extendrr)�self�input�errorsr#�labelsr�trailing_dotrrrr�s4



zCodec.encodecCs�|dkrtd|��|sdSt|t�s.t|�}t|kr^y|�d�t|�fStk
r\YnX|�d�}|r�t|d�dkr�d}|d=nd	}g}x|D]}|�t	|��q�Wd�
|�|t|�fS)
Nr&zUnsupported error handling )rrrr(rr�.r)rrrrr!r�UnicodeDecodeErrorr*rr$r
)r.r/r0r1r2r#rrrrr!�s(


zCodec.decodeN)r&)r&)�__name__�
__module__�__qualname__rr!rrrrr%�s
%r%c@seZdZdd�ZdS)�IncrementalEncoderc	Cs�|dkrtd|��|sdSt�|�}d}|rT|dsBd}|d=n|sT|d=|rTd}t�}d}x<|D]4}|r~|�d�|d7}|�t|��|t|�7}qdW||7}|t|�7}t|�|fS)	Nr&zunsupported error handling )r'rr'rr(r�)rr,r*r+r-rrr)	r.r/r0�finalr1r2r#�sizerrrr�_buffer_encode�s2


z!IncrementalEncoder._buffer_encodeN)r5r6r7r<rrrrr8�sr8c@seZdZdd�ZdS)�IncrementalDecoderc	Cs�|dkrtd|��|sdSt|t�r2t�|�}nt|d�}|�d�}d}|rt|dsbd}|d=n|st|d=|rtd}g}d}x2|D]*}|�t|��|r�|d	7}|t|�7}q�Wd�|�|}|t|�7}||fS)
Nr&zUnsupported error handling )rrrr3rrrr9)	rrr r,r*rr$rr
)	r.r/r0r:r1r2r#r;rrrr�_buffer_decode�s6



z!IncrementalDecoder._buffer_decodeN)r5r6r7r>rrrrr=�sr=c@seZdZdS)�StreamWriterN)r5r6r7rrrrr?"sr?c@seZdZdS)�StreamReaderN)r5r6r7rrrrr@%sr@c	Cs tjdt�jt�jttttd�S)NZidna)�namerr!�incrementalencoder�incrementaldecoder�streamwriter�streamreader)	�codecs�	CodecInfor%rr!r8r=r?r@rrrr�getregentry*srH)r�rerFrr�compiler,rrrrr$r%�BufferedIncrementalEncoderr8�BufferedIncrementalDecoderr=r?r@rHrrrr�<module>s
.+)H#'

Hacked By AnonymousFox1.0, Coded By AnonymousFox