B Re @sddlmZmZmZmZmZddlZddlZedZ Gdddej Z Gdddej Z Gd d d ej ZGd d d e ejZGd dde ejZddZdS))encodedecodealabelulabel IDNAErrorNu [.。.。]c@s eZdZdddZdddZdS) CodecstrictcCs.|dkrtd||sdSt|t|fS)Nr z Unsupported error handling "{0}")r)rformatrlen)selfdataerrorsr/builddir/build/BUILDROOT/alt-python37-pip-20.2.4-6.el8.x86_64/opt/alt/python37/lib/python3.7/site-packages/pip/_vendor/idna/codec.pyr s z Codec.encodecCs.|dkrtd||sdSt|t|fS)Nr z Unsupported error handling "{0}")r r)rr rr )r rrrrrrs z Codec.decodeN)r )r )__name__ __module__ __qualname__rrrrrrrs rc@seZdZddZdS)IncrementalEncoderc Cs|dkrtd||sdSt|}d}|rV|dsDd}|d=n|sV|d=|rVd}g}d}x2|D]*}|t||r|d7}|t|7}qdWd||}|t|7}||fS) Nr z Unsupported error handling "{0}")r rr .rr)rr _unicode_dots_resplitappendrr join) r rrfinallabels trailing_dotresultsizelabelrrr_buffer_encodes0   z!IncrementalEncoder._buffer_encodeN)rrrr"rrrrrsrc@seZdZddZdS)IncrementalDecoderc Cs|dkrtd||sdSt|tr4t|}nt|}t|d|d}d}|r~|dsld}|d=n|s~|d=|r~d}g}d}x2|D]*}|t||r|d 7}|t |7}qWd ||}|t |7}||fS) Nr z Unsupported error handling "{0}")r rasciirr rrr) rr isinstanceunicoderrstrrrr r) r rrrrrrr r!rrr_buffer_decode?s8      z!IncrementalDecoder._buffer_decodeN)rrrr(rrrrr#>sr#c@s eZdZdS) StreamWriterN)rrrrrrrr)gsr)c@s eZdZdS) StreamReaderN)rrrrrrrr*jsr*c Cs tjdtjtjttttdS)Nidna)namerrincrementalencoderincrementaldecoder streamwriter streamreader) codecs CodecInforrrrr#r)r*rrrr getregentrymsr3)corerrrrrr1recompilerrBufferedIncrementalEncoderrBufferedIncrementalDecoderr#r)r*r3rrrrs !)