a Z^; @sJddlZddlZz ddlTWn0eyLZzedeWYdZ[n dZ[00gdZdZdZZ dZ Z dZ d Z ejd kre ZZe Zn e ZZe Ze Ze Ze Ze ZGd d d eZGd ddZGdddeZGdddeZGdddeZGdddeZGdddeZGdddeZGdddZ GdddZ!dBd"d#Z"dCd$d%Z#d&d'Z$d(d)Z%d*d+Z&d,d-Z'd.d/Z(d0d1Z)dDd2d3Z*dEd4d5Z+d6d7Z,d8d9Z-z4e.d Z/e.d:Z0e.d;Z1e.d<Z2e.d=Z3e.d>Z4Wn,e5ydZ/dZ0dZ1dZ2dZ3dZ4Yn0dZ6e6rddl7Z7e8d?krFe#ej9d@dAe_9e#ej:dAd@e_:dS)FN)*z%Failed to load the builtin codecs: %s),registerlookupopen 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} || _|| _|| _|| _|| _|| _|| _|durL|| _ | SN) tuple__new__namer#r$incrementalencoderincrementaldecoder streamwriter streamreaderr0) clsr#r$r8r7r5r6r4r0selfr;/usr/lib64/python3.9/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  rc@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 rc@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  rc@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  rc@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   rc@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 CsP|jr|j|j|_d|_|dkr(|}|dkrBt|j|krBq|dkrV|j}n |j|}|j|}|stqz|||j \}}Wnbt y}zJ|r||d|j |j \}}|j dd} t| dkr؂nWYd}~n d}~00||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|dur|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   rc@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       rc@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|dur|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"     rrrDrcCst|durd|vr|d}t|||}|dur2|Sz&t|}t||j|j|}||_|WS|Yn0dS)Nb)builtinsrrrr8r7rrv)filenamemoderrI bufferingfileinfosrwr;r;r<rgsrcCsF|dur |}t|}t|}t||j|j|j|j|}||_||_|Sr1)rrr#r$r8r7rr)rrrrI data_info file_infosrr;r;r<rs  rcCs t|jSr1)rr#rr;r;r<rsrcCs t|jSr1)rr$rr;r;r<rsrcCst|j}|durt||Sr1)rr5 LookupError)rencoderr;r;r<rs rcCst|j}|durt||Sr1)rr6r)rdecoderr;r;r<r s r cCs t|jSr1)rr8rr;r;r<r!sr!cCs t|jSr1)rr7rr;r;r<r"sr"cksLt||fi|}|D]}||}|r|Vq|dd}|rH|VdS)NrKT)rr#)iteratorrrIkwargsrrHoutputr;r;r<r%s   r%cksLt||fi|}|D]}||}|r|Vq|dd}|rH|VdS)Nr_T)r r$)rrrIrrrHrr;r;r<r&s   r&cCsdd|DS)NcSsi|] }||qSr;r;).0ir;r;r< /r_z&make_identity_dict..r;)rngr;r;r<make_identity_dict'srcCs4i}|D]"\}}||vr&|||<q d||<q |Sr1)items) decoding_mapmkvr;r;r<make_encoding_map1s   rignorereplacexmlcharrefreplacebackslashreplace namereplace__main__zlatin-1zutf-8)rNrDr)NrD)rD)rD);rsys_codecs ImportErrorwhy SystemError__all__rr rrrrr byteorderrrrr r r r r2rrrfrrWrr`rrrrrrrrrr r!r"r%r&rrr.r'r(r)r*r+r,r_false encodingsrCstdoutstdinr;r;r;r< s~ " B("1+IzWt 0 &