U e5d;,@sddlZddlZz ddlTWn.ek rJZzedeW5dZ[XYnXdddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/g,Zd0Zd1ZZ d2Z Z d3Z d4Z ejd5kre ZZe Zn e ZZe Ze Ze Ze Ze ZGd6ddeZGd7ddZGd8ddeZGd9d:d:eZGd;ddeZGdddeZGd?ddeZGd@ddZ GdAddZ!d[dEdZ"d\dFdZ#dGdZ$dHdZ%dId Z&dJd!Z'dKd"Z(dLd#Z)d]dMd&Z*d^dNd'Z+dOdPZ,dQdRZ-z4e.dCZ/e.dSZ0e.dTZ1e.dUZ2e.dVZ3e.dWZ4Wn.e5k r\dZ/dZ0dZ1dZ2dZ3dZ4YnXdZ6e6rpddl7Z7e8dXkre#ej9dYdZe_9e#ej:dZdYe_:dS)_N)*z%Failed to load the builtin codecs: %sregisterlookupopen EncodedFileBOMBOM_BEBOM_LEBOM32_BEBOM32_LEBOM64_BEBOM64_LEBOM_UTF8 BOM_UTF16 BOM_UTF16_LE BOM_UTF16_BE BOM_UTF32 BOM_UTF32_LE BOM_UTF32_BE CodecInfoCodecIncrementalEncoderIncrementalDecoder StreamReader StreamWriterStreamReaderWriter StreamRecoder getencoder getdecodergetincrementalencodergetincrementaldecoder getreader getwriterencodedecode iterencode iterdecode strict_errors ignore_errorsreplace_errorsxmlcharrefreplace_errorsbackslashreplace_errorsnamereplace_errorsregister_error lookup_errorssssslittlec@s(eZdZdZdddddZddZdS) rTN)_is_text_encodingc CsPt|||||f} || _|| _|| _|| _|| _|| _|| _|dk rL|| _ | SN) tuple__new__namer#r$incrementalencoderincrementaldecoder streamwriter streamreaderr0) clsr#r$r8r7r5r6r4r0selfr;/usr/lib64/python3.8/codecs.pyr3^szCodecInfo.__new__cCsd|jj|jj|jt|fS)Nz%<%s.%s object for encoding %s at %#x>) __class__ __module__ __qualname__r4idr:r;r;r<__repr__ms  zCodecInfo.__repr__)NNNNN)__name__r>r?r0r3rBr;r;r;r<rSs  c@s eZdZdddZdddZdS) rstrictcCstdSr1NotImplementedErrorr:inputerrorsr;r;r<r#sz Codec.encodecCstdSr1rErGr;r;r<r$sz Codec.decodeN)rD)rD)rCr>r?r#r$r;r;r;r<rrs c@s8eZdZdddZdddZddZd d Zd d Zd S)rrDcCs||_d|_dSN)rIbufferr:rIr;r;r<__init__szIncrementalEncoder.__init__FcCstdSr1rEr:rHfinalr;r;r<r#szIncrementalEncoder.encodecCsdSr1r;rAr;r;r<resetszIncrementalEncoder.resetcCsdSNrr;rAr;r;r<getstateszIncrementalEncoder.getstatecCsdSr1r;r:stater;r;r<setstateszIncrementalEncoder.setstateN)rD)F)rCr>r?rNr#rQrSrVr;r;r;r<rs  c@s@eZdZdddZddZdddZd d Zd d Zd dZdS)BufferedIncrementalEncoderrDcCst||d|_dSrJ)rrNrLrMr;r;r<rNs z#BufferedIncrementalEncoder.__init__cCstdSr1rEr:rHrIrPr;r;r<_buffer_encodesz)BufferedIncrementalEncoder._buffer_encodeFcCs0|j|}|||j|\}}||d|_|Sr1)rLrYrIr:rHrPdataresultconsumedr;r;r<r#s z!BufferedIncrementalEncoder.encodecCst|d|_dSrJ)rrQrLrAr;r;r<rQs z BufferedIncrementalEncoder.resetcCs |jpdSrRrLrAr;r;r<rSsz#BufferedIncrementalEncoder.getstatecCs|pd|_dSrJr^rTr;r;r<rVsz#BufferedIncrementalEncoder.setstateN)rD)F) rCr>r?rNrYr#rQrSrVr;r;r;r<rWs   rWc@s8eZdZdddZdddZddZd d Zd d Zd S)rrDcCs ||_dSr1)rIrMr;r;r<rNszIncrementalDecoder.__init__FcCstdSr1rErOr;r;r<r$szIncrementalDecoder.decodecCsdSr1r;rAr;r;r<rQszIncrementalDecoder.resetcCsdS)N)rr;rAr;r;r<rSs zIncrementalDecoder.getstatecCsdSr1r;rTr;r;r<rV'szIncrementalDecoder.setstateN)rD)F)rCr>r?rNr$rQrSrVr;r;r;r<rs  c@s@eZdZdddZddZdddZd d Zd d Zd dZdS)BufferedIncrementalDecoderrDcCst||d|_dSNr_)rrNrLrMr;r;r<rN5s z#BufferedIncrementalDecoder.__init__cCstdSr1rErXr;r;r<_buffer_decode:sz)BufferedIncrementalDecoder._buffer_decodeFcCs0|j|}|||j|\}}||d|_|Sr1)rLrbrIrZr;r;r<r$?s z!BufferedIncrementalDecoder.decodecCst|d|_dSra)rrQrLrAr;r;r<rQGs z BufferedIncrementalDecoder.resetcCs |jdfSrRr^rAr;r;r<rSKsz#BufferedIncrementalDecoder.getstatecCs|d|_dSrRr^rTr;r;r<rVOsz#BufferedIncrementalDecoder.setstateN)rD)F) rCr>r?rNrbr$rQrSrVr;r;r;r<r`/s   r`c@sTeZdZdddZddZddZdd Zdd d Zefd dZ ddZ ddZ dS)rrDcCs||_||_dSr1)streamrIr:rcrIr;r;r<rN\szStreamWriter.__init__cCs"|||j\}}|j|dSr1)r#rIrcwrite)r:objectr[r]r;r;r<reuszStreamWriter.writecCs|d|dSrJ)rejoinr:listr;r;r< writelines|szStreamWriter.writelinescCsdSr1r;rAr;r;r<rQs zStreamWriter.resetrcCs*|j|||dkr&|dkr&|dSrRrcseekrQr:offsetwhencer;r;r<rlszStreamWriter.seekcCs ||j|Sr1rcr:r4getattrr;r;r< __getattr__szStreamWriter.__getattr__cCs|Sr1r;rAr;r;r< __enter__szStreamWriter.__enter__cCs|jdSr1rccloser:typevaluetbr;r;r<__exit__szStreamWriter.__exit__N)rD)r) rCr>r?rNrerjrQrlrrrsrtr{r;r;r;r<rZs   c@seZdZeZdddZd ddZd!dd Zd"d d Zd#ddZ ddZ d$ddZ ddZ ddZ efddZddZddZd S)%rrDcCs.||_||_d|_||_|j|_d|_dSra)rcrI bytebuffercharbuffertype_empty_charbuffer charbuffer linebufferrdr;r;r<rNs  zStreamReader.__init__cCstdSr1rErGr;r;r<r$szStreamReader.decodeFc CsN|jr|j|j|_d|_|dkr(|}|dkrBt|j|krBq|dkrV|j}n |j|}|j|}|stqz|||j \}}Wn`t k r}zB|r||d|j |j \}}|j dd} t| dkrڂnW5d}~XYnX||d|_|j|7_|s(qq(|dkr,|j} |j|_n|jd|} |j|d|_| S)NrTkeepends) rr~rgrlenrcreadr|r$rIUnicodeDecodeErrorstart splitlines) r:sizechars firstlinenewdatar[newchars decodedbytesexclinesr\r;r;r<rsD       zStreamReader.readNTc Cs|jrP|jd}|jd=t|jdkr8|jd|_d|_|sL|jddd}|S|pVd}|j}|j|dd}|rt|tr|dst|t r|d r||jddd 7}||7}|jdd}|rt|dkr8|d}|d=t|dkr|d |j7<||_d|_n|d|j|_|s|jddd}q|d}|djddd}||kr|j |dd|j|_|r|}n|}q|r|dk r|r|s|jddd}q|d kr^|d 9}q^|S)NrrFrHT)r  )rrri@) rrrrr~r isinstancestrendswithbytesrg) r:rrlinereadsizer[r line0withendline0withoutendr;r;r<readlinesd       zStreamReader.readlinecCs|}||Sr1)rr)r:sizehintrr[r;r;r< readlines^s zStreamReader.readlinescCsd|_|j|_d|_dSra)r|r~rrrAr;r;r<rQms zStreamReader.resetrcCs|j|||dSr1rkrmr;r;r<rlzszStreamReader.seekcCs|}|r|StdSr1)r StopIteration)r:rr;r;r<__next__szStreamReader.__next__cCs|Sr1r;rAr;r;r<__iter__szStreamReader.__iter__cCs ||j|Sr1rprqr;r;r<rsszStreamReader.__getattr__cCs|Sr1r;rAr;r;r<rtszStreamReader.__enter__cCs|jdSr1rurwr;r;r<r{szStreamReader.__exit__)rD)rD)rrF)NT)NT)r)rCr>r?rr}rNr$rrrrQrlrrrrrsrtr{r;r;r;r<rs   P K   c@seZdZdZd ddZd!ddZd"d d Zd#d d Zd dZddZ ddZ ddZ ddZ d$ddZ efddZddZddZdS)%runknownrDcCs(||_||||_||||_||_dSr1)rcreaderwriterrI)r:rcReaderWriterrIr;r;r<rNs   zStreamReaderWriter.__init__rcCs |j|Sr1)rrr:rr;r;r<rszStreamReaderWriter.readNcCs |j|Sr1)rrrr;r;r<rszStreamReaderWriter.readlinecCs |j|Sr1)rr)r:rr;r;r<rszStreamReaderWriter.readlinescCs t|jSr1)nextrrAr;r;r<rszStreamReaderWriter.__next__cCs|Sr1r;rAr;r;r<rszStreamReaderWriter.__iter__cCs |j|Sr1)rre)r:r[r;r;r<reszStreamReaderWriter.writecCs |j|Sr1)rrjrhr;r;r<rjszStreamReaderWriter.writelinescCs|j|jdSr1rrQrrAr;r;r<rQs zStreamReaderWriter.resetrcCs6|j|||j|dkr2|dkr2|jdSrR)rcrlrrQrrmr;r;r<rls zStreamReaderWriter.seekcCs ||j|Sr1rprqr;r;r<rsszStreamReaderWriter.__getattr__cCs|Sr1r;rAr;r;r<rtszStreamReaderWriter.__enter__cCs|jdSr1rurwr;r;r<r{szStreamReaderWriter.__exit__)rD)r)N)N)r)rCr>r?encodingrNrrrrrrerjrQrlrrrsrtr{r;r;r;r<rs       c@seZdZdZdZd ddZd!ddZd"d d Zd#d d Zd dZ ddZ ddZ ddZ ddZ d$ddZefddZddZddZdS)%rrrDcCs4||_||_||_||||_||||_||_dSr1)rcr#r$rrrI)r:rcr#r$rrrIr;r;r<rNs   zStreamRecoder.__init__rcCs"|j|}|||j\}}|Sr1)rrr#rIr:rr[ bytesencodedr;r;r<r#s zStreamRecoder.readNcCs6|dkr|j}n |j|}|||j\}}|Sr1)rrr#rIrr;r;r<r)s   zStreamRecoder.readlinecCs(|j}|||j\}}|jddS)NTr)rrr#rIr)r:rr[rr;r;r<r2s zStreamRecoder.readlinescCs t|j}|||j\}}|Sr1)rrr#rI)r:r[rr;r;r<r8s zStreamRecoder.__next__cCs|Sr1r;rAr;r;r<r?szStreamRecoder.__iter__cCs|||j\}}|j|Sr1)r$rIrre)r:r[ bytesdecodedr;r;r<reBszStreamRecoder.writecCs(d|}|||j\}}|j|Sra)rgr$rIrre)r:rir[rr;r;r<rjGs zStreamRecoder.writelinescCs|j|jdSr1rrAr;r;r<rQMs zStreamRecoder.resetrcCs |j|||j||dSr1)rrlrrmr;r;r<rlRszStreamRecoder.seekcCs ||j|Sr1rprqr;r;r<rsXszStreamRecoder.__getattr__cCs|Sr1r;rAr;r;r<rt_szStreamRecoder.__enter__cCs|jdSr1rurwr;r;r<r{bszStreamRecoder.__exit__)rD)r)N)N)r)rCr>r? data_encoding file_encodingrNrrrrrrerjrQrlrrrsrtr{r;r;r;r<rs"     rrDrcCst|dk rd|kr|d}t|||}|dkr2|Sz&t|}t||j|j|}||_|WS|YnXdS)Nb)builtinsrrrr8r7rrv)filenamemoderrI bufferingfileinfosrwr;r;r<rgscCsF|dkr |}t|}t|}t||j|j|j|j|}||_||_|Sr1)rrr#r$r8r7rr)rrrrI data_info file_infosrr;r;r<rs cCs t|jSr1)rr#rr;r;r<rscCs t|jSr1)rr$rr;r;r<rscCst|j}|dkrt||Sr1)rr5 LookupError)rencoderr;r;r<rs cCst|j}|dkrt||Sr1)rr6r)rdecoderr;r;r<r s cCs t|jSr1)rr8rr;r;r<r!scCs t|jSr1)rr7rr;r;r<r"scksHt||f|}|D]}||}|r|Vq|dd}|rD|VdS)NrKT)rr#)iteratorrrIkwargsrrHoutputr;r;r<r%s   cksHt||f|}|D]}||}|r|Vq|dd}|rD|VdS)Nr_T)r r$)rrrIrrrHrr;r;r<r&s   cCsdd|DS)NcSsi|] }||qSr;r;).0ir;r;r< /sz&make_identity_dict..r;)rngr;r;r<make_identity_dict'srcCs4i}|D]"\}}||kr&|||<q d||<q |Sr1)items) decoding_mapmkvr;r;r<make_encoding_map1s   rignorereplacexmlcharrefreplacebackslashreplace namereplace__main__zlatin-1zutf-8)rNrDr)NrD)rD)rD);rsys_codecs ImportErrorZwhy SystemError__all__rr rrrrr byteorderrrrr r r r r2rrrfrrWrr`rrrrrrrrrr r!r"r%r&rrr.r'r(r)r*r+r,r_falseZ encodingsrCstdoutstdinr;r;r;r< s   B("1+IzWt 0 &