a Z^;c @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*z%Failed to load the builtin codecs: %s),Zregisterlookupopen 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_errorsZregister_error lookup_errorsssssZlittlec@s(eZdZdZdddddZddZdS) rTN)_is_text_encodingc CsPt|||||f} || _|| _|| _|| _|| _|| _|| _|durL|| _ | SN) tuple__new__namer r!incrementalencoderincrementaldecoder streamwriter streamreaderr+) Zclsr r!r3r2r0r1r/r+selfr5/usr/lib64/python3.9/codecs.pyr.^szCodecInfo.__new__cCsd|jj|jj|jt|fS)Nz%<%s.%s object for encoding %s at %#x>)Z __class__ __module__ __qualname__r/Zidr4r5r5r6__repr__ms   zCodecInfo.__repr__)NNNNN)__name__r7r8r+r.r:r5r5r5r6rSs  rc@s eZdZdddZdddZdS) rstrictcCtdSr,ZNotImplementedErrorr4inputerrorsr5r5r6r sz Codec.encodecCr=r,r>r?r5r5r6r!sz Codec.decodeNr<rB)r;r7r8r r!r5r5r5r6rrs rc@8eZdZdddZdddZddZd d Zd d Zd S)rr<cCs||_d|_dSN)rAbufferr4rAr5r5r6__init__szIncrementalEncoder.__init__FcCr=r,r>r4r@finalr5r5r6r zIncrementalEncoder.encodecCdSr,r5r9r5r5r6resetzIncrementalEncoder.resetcCdSNrr5r9r5r5r6getstaterKzIncrementalEncoder.getstatecCrLr,r5r4Zstater5r5r6setstaterNzIncrementalEncoder.setstateNrBF)r;r7r8rHr rMrQrSr5r5r5r6rs  rc@@eZdZdddZddZdddZd d Zd d Zd dZdS)BufferedIncrementalEncoderr<cCt||d|_dSrD)rrHrFrGr5r5r6rH z#BufferedIncrementalEncoder.__init__cCr=r,r>r4r@rArJr5r5r6_buffer_encodez)BufferedIncrementalEncoder._buffer_encodeFcC0|j|}|||j|\}}||d|_|Sr,)rFrZrAr4r@rJdataresultconsumedr5r5r6r  z!BufferedIncrementalEncoder.encodecCt|d|_dSrD)rrMrFr9r5r5r6rM z BufferedIncrementalEncoder.resetcCs |jpdSrPrFr9r5r5r6rQrNz#BufferedIncrementalEncoder.getstatecCs|pd|_dSrDrdrRr5r5r6rSrNz#BufferedIncrementalEncoder.setstateNrBrT) r;r7r8rHrZr rMrQrSr5r5r5r6rVs   rVc@rC)rr<cCs ||_dSr,)rArGr5r5r6rHzIncrementalDecoder.__init__FcCr=r,r>rIr5r5r6r!rKzIncrementalDecoder.decodecCrLr,r5r9r5r5r6rMrNzIncrementalDecoder.resetcCrO)N)rr5r9r5r5r6rQs zIncrementalDecoder.getstatecCrLr,r5rRr5r5r6rS'rNzIncrementalDecoder.setstateNrBrT)r;r7r8rHr!rMrQrSr5r5r5r6rs  rc@rU)BufferedIncrementalDecoderr<cCrWNrf)rrHrFrGr5r5r6rH5rXz#BufferedIncrementalDecoder.__init__cCr=r,r>rYr5r5r6_buffer_decode:r[z)BufferedIncrementalDecoder._buffer_decodeFcCr\r,)rFrirAr]r5r5r6r!?raz!BufferedIncrementalDecoder.decodecCrbrh)rrMrFr9r5r5r6rMGrcz BufferedIncrementalDecoder.resetcCs |jdfSrPrdr9r5r5r6rQKz#BufferedIncrementalDecoder.getstatecCs|d|_dSrPrdrRr5r5r6rSOrjz#BufferedIncrementalDecoder.setstateNrBrT) r;r7r8rHrir!rMrQrSr5r5r5r6rg/s   rgc@sTeZdZdddZddZddZdd Zdd d Zefd dZ ddZ ddZ dS)rr<cCs||_||_dSr,)streamrAr4rkrAr5r5r6rH\szStreamWriter.__init__cCs"|||j\}}|j|dSr,)r rArkwrite)r4objectr^r`r5r5r6rmuszStreamWriter.writecCs|d|dSrD)rmjoinr4listr5r5r6 writelines|zStreamWriter.writelinescCrLr,r5r9r5r5r6rMs zStreamWriter.resetrcCs*|j|||dkr&|dkr&|dSrPrkseekrMr4ZoffsetZwhencer5r5r6ruszStreamWriter.seekcC ||j|Sr,rkr4r/getattrr5r5r6 __getattr__rszStreamWriter.__getattr__cC|Sr,r5r9r5r5r6 __enter__rNzStreamWriter.__enter__cC|jdSr,rkcloser4ZtypeZvalueZtbr5r5r6__exit__rNzStreamWriter.__exit__NrBr) r;r7r8rHrmrrrMrurzr{r}rr5r5r5r6rZs   rc@seZdZeZdddZd ddZd!dd Zd"d d Zd#ddZ ddZ d$ddZ ddZ ddZ efddZddZddZd S)%rr<cCs.||_||_d|_||_|j|_d|_dSrh)rkrA bytebuffercharbuffertype_empty_charbuffer charbuffer linebufferrlr5r5r6rHs  zStreamReader.__init__cCr=r,r>r?r5r5r6r!rNzStreamReader.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) rrrorlenrkreadrr!rAZUnicodeDecodeErrorZstart splitlines) r4sizechars firstlineZnewdatar^ZnewcharsZ decodedbytesZexclinesr_r5r5r6rsD       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)NrrFriHT)rz s )rrri@i) rrrrrrZ isinstancestrZendswithZbytesro) r4rrlineZreadsizer^rZ line0withendZline0withoutendr5r5r6readlinesd       zStreamReader.readlinecCs|}||Sr,)rr)r4sizehintrr^r5r5r6 readlines^s zStreamReader.readlinescCsd|_|j|_d|_dSrh)rrrrr9r5r5r6rMms zStreamReader.resetrcCs|j|||dSr,rtrvr5r5r6ruzszStreamReader.seekcCs|}|r|StdSr,)rZ StopIteration)r4rr5r5r6__next__szStreamReader.__next__cCr|r,r5r9r5r5r6__iter__rNzStreamReader.__iter__cCrwr,rxryr5r5r6r{rszStreamReader.__getattr__cCr|r,r5r9r5r5r6r}rNzStreamReader.__enter__cCr~r,rrr5r5r6rrNzStreamReader.__exit__rBrB)rrFNTrr)r;r7r8rrrHr!rrrrMrurrrzr{r}rr5r5r5r6rs   P K   rc@seZdZdZd ddZd!ddZd"d d Zd#d d Zd dZddZ ddZ ddZ ddZ d$ddZ efddZddZddZdS)%runknownr<cCs(||_||||_||||_||_dSr,)rkreaderwriterrA)r4rkReaderWriterrAr5r5r6rHs   zStreamReaderWriter.__init__rcC |j|Sr,)rrr4rr5r5r6rrjzStreamReaderWriter.readNcCrr,)rrrr5r5r6rrjzStreamReaderWriter.readlinecCrr,)rr)r4rr5r5r6rrjzStreamReaderWriter.readlinescCs t|jSr,)nextrr9r5r5r6rr[zStreamReaderWriter.__next__cCr|r,r5r9r5r5r6rrNzStreamReaderWriter.__iter__cCrr,)rrm)r4r^r5r5r6rmrjzStreamReaderWriter.writecCrr,)rrrrpr5r5r6rrrjzStreamReaderWriter.writelinescC|j|jdSr,rrMrr9r5r5r6rM zStreamReaderWriter.resetrcCs6|j|||j|dkr2|dkr2|jdSrP)rkrurrMrrvr5r5r6rus zStreamReaderWriter.seekcCrwr,rxryr5r5r6r{rszStreamReaderWriter.__getattr__cCr|r,r5r9r5r5r6r}rNzStreamReaderWriter.__enter__cCr~r,rrr5r5r6rrNzStreamReaderWriter.__exit__rBrr,r,r)r;r7r8encodingrHrrrrrrmrrrMrurzr{r}rr5r5r5r6rs       rc@seZdZdZdZd ddZd!ddZd"d d Zd#d d Zd dZ ddZ ddZ ddZ ddZ d$ddZefddZddZddZdS)%rrr<cCs4||_||_||_||||_||||_||_dSr,)rkr r!rrrA)r4rkr r!rrrAr5r5r6rHs   zStreamRecoder.__init__rcCs"|j|}|||j\}}|Sr,)rrr rAr4rr^ bytesencodedr5r5r6r#s zStreamRecoder.readNcCs6|dur|j}n |j|}|||j\}}|Sr,)rrr rArr5r5r6r)s   zStreamRecoder.readlinecCs(|j}|||j\}}|jddS)NTr)rrr rAr)r4rr^rr5r5r6r2 zStreamRecoder.readlinescCs t|j}|||j\}}|Sr,)rrr rA)r4r^rr5r5r6r8s zStreamRecoder.__next__cCr|r,r5r9r5r5r6r?rNzStreamRecoder.__iter__cCs|||j\}}|j|Sr,)r!rArrm)r4r^ bytesdecodedr5r5r6rmBszStreamRecoder.writecCs(d|}|||j\}}|j|Srh)ror!rArrm)r4rqr^rr5r5r6rrGrzStreamRecoder.writelinescCrr,rr9r5r5r6rMMrzStreamRecoder.resetrcCs |j|||j||dSr,)rrurrvr5r5r6ruRszStreamRecoder.seekcCrwr,rxryr5r5r6r{XrszStreamRecoder.__getattr__cCr|r,r5r9r5r5r6r}_rNzStreamRecoder.__enter__cCr~r,rrr5r5r6rbrNzStreamRecoder.__exit__rBrr,r,r)r;r7r8 data_encoding file_encodingrHrrrrrrmrrrMrurzr{r}rr5r5r5r6rs"     rrr<rcCst|durd|vr|d}t|||}|dur2|Sz&t|}t||j|j|}||_|WS|Yn0dS)NZb)builtinsrrrr3r2rr)ZfilenameZmoderrAZ bufferingfileZinfoZsrwr5r5r6rgsrcCsF|dur |}t|}t|}t||j|j|j|j|}||_||_|Sr,)rrr r!r3r2rr)rrrrAZ data_infoZ file_infoZsrr5r5r6rs  rcC t|jSr,)rr rr5r5r6rrercCrr,)rr!rr5r5r6rrercCt|j}|durt||Sr,)rr0 LookupError)rencoderr5r5r6r rcCrr,)rr1r)rdecoderr5r5r6rrrcCrr,)rr3rr5r5r6rrercCrr,)rr2rr5r5r6rrerckLt||fi|}|D]}||}|r|Vq|dd}|rH|VdS)NrET)rr )iteratorrrAkwargsrr@outputr5r5r6r"   r"ckr)NrfT)rr!)rrrArrr@rr5r5r6r#rr#cCsdd|DS)NcSsi|] }||qSr5r5)Z.0Zir5r5r6Z /rfz&make_identity_dict..r5)Zrngr5r5r6make_identity_dict'rercCs4i}|D]"\}}||vr&|||<q d||<q |Sr,)Zitems)Z decoding_mapZmZkZvr5r5r6make_encoding_map1s   rZignoreZreplaceZxmlcharrefreplaceZbackslashreplaceZ namereplaceZ__main__zlatin-1zutf-8)rNr<r)Nr<rBrB);rZsysZ_codecsZ ImportErrorZwhyZ SystemErrorZ__all__r rr rrrrZ byteorderrr rrrr r r-rrrnrrVrrgrrrrrrrrrrrrr"r#rrr*r$r%r&r'r(r)rZ_falseZ encodingsr;ZstdoutZstdinr5r5r5r6Z s~ " B("1+IzWt 0 &