B 49$@sddlZddlZddlZddlmZedZdZdZddZ dd Z d d Z Gd d d ej Z Gdddej ZGdddejZGddde ejZGddde ejZddZdS)N) ucd_3_2_0u [.。.。]sxn--zxn--cCsg}x(|D] }t|rq |t|q Wd|}td|}xr|D]j}t|st|st |st |st |st |st |st|st|rJtd|qJWdd|D}t|rtdd|Drtd|d r|d std |S) NNFKCzInvalid character %rcSsg|]}t|qS) stringprepZ in_table_d1).0xrr1/opt/alt/python37/lib/python3.7/encodings/idna.py )sznameprep..css|]}t|VqdS)N)rZ in_table_d2)rrrrr 1sznameprep..zViolation of BIDI requirement 2rzViolation of BIDI requirement 3)rZ in_table_b1appendZ map_table_b2join unicodedata normalizeZ in_table_c12Z in_table_c22Z in_table_c3Z in_table_c4Z in_table_c5Z in_table_c6Z in_table_c7Z in_table_c8Z in_table_c9 UnicodeErrorany)labelZnewlabelcZRandALrrr namepreps2               rcCsy|d}Wntk r"Yn*Xdt|krYnhX|d}x6|ddD]&}dt|krtdksXntd qXWt|ddkrtd |t|fSt}t|}|r|dsd}|d=nd }x(|D] }|r|d|t|qWt ||t|fS) Nr'zunsupported error handling )rr.r rrzlabel empty or too longzlabel too longr() rrUnicodeEncodeErrorsplitr bytearraydotsextendrr )selfinputerrorsr$labelsr trailing_dotrrr rs4        z Codec.encodecCs|dkrtd||sdSt|ts.t|}t|kr^y|dt|fStk r\YnX|d}|rt|ddkrd}|d=nd }g}x|D]}|t |qWd ||t|fS) Nr'zUnsupported error handling )rrrr)r r.r) rrr rr"rUnicodeDecodeErrorr+r r%r)r/r0r1r2r3r$rrrr r"s(    z Codec.decodeN)r')r')__name__ __module__ __qualname__rr"rrrr r&s %r&c@seZdZddZdS)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(r r)r)rr-r+r,r.rrr ) r/r0r1finalr2r3r$sizerrrr _buffer_encodes2     z!IncrementalEncoder._buffer_encodeN)r6r7r8r=rrrr r9sr9c@seZdZddZdS)IncrementalDecoderc Cs|dkrtd||sdSt|tr2t|}nt|d}|d}d}|rt|dsbd}|d=n|st|d=|rtd}g}d}x2|D]*}|t||r|d 7}|t|7}qWd||}|t|7}||fS) Nr'zUnsupported error handling )rrrr4rr rr:) rrr!r-r+r r%rr) r/r0r1r;r2r3r$r<rrrr _buffer_decodes6       z!IncrementalDecoder._buffer_decodeN)r6r7r8r?rrrr r>sr>c@s eZdZdS) StreamWriterN)r6r7r8rrrr r@"sr@c@s eZdZdS) StreamReaderN)r6r7r8rrrr rA%srAc Cs tjdtjtjttttdS)NZidna)namerr"incrementalencoderincrementaldecoder streamwriter streamreader) codecs CodecInfor&rr"r9r>r@rArrrr getregentry*srI)rrerGrrcompiler-rrrrr%r&BufferedIncrementalEncoderr9BufferedIncrementalDecoderr>r@rArIrrrr s  .+)H#'