a Z^# @sddlZddlZddlmZdddZddd ZGd d d ejZGd d d ejZGdddejZGdddeej Z Gdddeej Z ddZ dS)N)BytesIOstrictc Cst|}t}|j}|j}|dd}|dd}|d|d@|fd|d}|rp|t||d}qT|d |t|fS) N z\n z\rz begin %o %s iascii-s end ) rreadwritereplaceencodebinasciiZb2a_uugetvaluelen) inputerrorsfilenamemodeinfileoutfiler r chunkr*/usr/lib64/python3.9/encodings/uu_codec.py uu_encodes   rc Cst|}t}|j}|j}|}|s,td|dddkrq@q|}|r|dkrTqzt|}WnTtjy}z:|ddd@ddd } t|d| }WYd}~n d}~00||q@|std |t|fS) Nz"Missing "begin" line in input datasbeginsend r ?zTruncated input data) rreadliner ValueErrorrZa2b_uuErrorrr) rrrrr r sdatavnbytesrrr uu_decode%s* ( r'c@s eZdZdddZdddZdS) CodecrcCs t||SN)rselfrrrrrr Gsz Codec.encodecCs t||Sr))r'r*rrrdecodeJsz Codec.decodeN)r)r)__name__ __module__ __qualname__r r,rrrrr(Fs r(c@seZdZdddZdS)IncrementalEncoderFcCst||jdSNr)rrr+rfinalrrrr NszIncrementalEncoder.encodeN)F)r-r.r/r rrrrr0Msr0c@seZdZdddZdS)IncrementalDecoderFcCst||jdSr1)r'rr2rrrr,RszIncrementalDecoder.decodeN)F)r-r.r/r,rrrrr4Qsr4c@seZdZeZdS) StreamWriterNr-r.r/bytescharbuffertyperrrrr5Usr5c@seZdZeZdS) StreamReaderNr6rrrrr9Xsr9c CstjdttttttddS)NuuF)namer r,incrementalencoderincrementaldecoder streamreader streamwriter_is_text_encoding)codecs CodecInforr'r0r4r9r5rrrr getregentry]srC)rrr)r) rAriorrr'r(r0r4r5r9rCrrrr s   !