a Z^# c@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) NZ z\nz z\rz begin %o %s iZasciii-s end ) rreadwriteZreplaceencodebinasciiZb2a_uugetvaluelen) inputerrorsZfilenameZmodeinfileoutfilerrZchunkr*/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 dataisbeginsend ri i?iizTruncated input data) rreadlinerZ ValueErrorrZa2b_uuZErrorr r ) r r r rrrZsZdataZvZnbytesrrr uu_decode%s* ( rc@s eZdZdddZdddZdS) CodecrcC t||SN)rselfr r rrrrGz Codec.encodecCrr)rrrrrdecodeJrz Codec.decodeNrr)__name__ __module__ __qualname__rrrrrrrFs rc@eZdZdddZdS)IncrementalEncoderFcCt||jdSNr)rr rr ZfinalrrrrNrzIncrementalEncoder.encodeNF)rrrrrrrrr Mr c@r)IncrementalDecoderFcCr!r")rr r#rrrrRrzIncrementalDecoder.decodeNr$)rrrrrrrrr&Qr%r&c@eZdZeZdS) StreamWriterNrrrZbytesZcharbuffertyperrrrr(Ur%r(c@r') StreamReaderNr)rrrrr*Xr%r*c CstjdttttttddS)NZuuF)ZnamerrZincrementalencoderZincrementaldecoderZ streamreaderZ streamwriterZ_is_text_encoding)codecsZ CodecInforrr r&r*r(rrrr getregentry]sr,)rrrr) r+rZiorrrrr r&r(r*r,rrrrZ s   !