� c��j# ��� ddlZddlZddlmZdd�Zdd�ZGd�dej �ZGd�dej�ZGd �d ej�ZGd �d eej�Z Gd �deej�Z d�Z y)�N)�BytesIOc��t|�}t�}|j}|j}|jdd�}|jdd�}|d|dz|fzj d��|d�}|r&|t j |��|d�}|r�&|d �|j�t|�fS) N� z\n� z\rz begin %o %s i��ascii�-s end ) r�read�write�replace�encode�binascii�b2a_uu�getvalue�len) �input�errors�filename�mode�infile�outfiler r �chunks �+/usr/lib64/python3.12/encodings/uu_codec.py� uu_encoders��� �U�^�F��i�G� �;�;�D� �M�M�E�����U�+�H�����U�+�H� �?�d�U�l�H�5� 5� =� =�g� F�G� ��H�E� � �h�o�o�e�$�%��R��� � �+�� � � � ��E� � +�+�c���t|�}t�}|j}|j} |�}|s td��|dddk(rn� |�}|r|dk(rn t j |�}||��.|s td ��|j�t|�fS#tj $r6}|ddz dzdzdzd z} t j |d| �}Yd}~�ud}~wwxYw) Nz"Missing "begin" line in input data�sbeginsend r� �?��zTruncated input data) r�readliner � ValueErrorr �a2b_uu�Errorrr) rrrrr!r �s�data�v�nbytess r� uu_decoder)%s�� �U�^�F��i�G����H� �M�M�E� � �J����A�B� B� �R�a�5�H� � � � � �J���A��M� � /��?�?�1�%�D� �d� � � ��/�0�0� � � � ��E� � +�+���~�~� /��!��R��2�~��*�Q�.�1�4�F��?�?�1�W�f�:�.�D�� /�s�B$�$C-�7,C(�(C-c��eZdZdd�Zdd�Zy)�Codecc��t||�S�N)r��selfrrs rr z Codec.encodeG������'�'rc��t||�Sr-)r)r.s r�decodez Codec.decodeJr0rN��strict)�__name__� __module__� __qualname__r r2�rrr+r+Fs ��(�(rr+c��eZdZdd�Zy)�IncrementalEncoderc�4�t||j�dS�Nr)rr�r/r�finals rr zIncrementalEncoder.encodeN������ � �,�Q�/�/rN�F)r5r6r7r r8rrr:r:M���0rr:c��eZdZdd�Zy)�IncrementalDecoderc�4�t||j�dSr<)r)rr=s rr2zIncrementalDecoder.decodeRr?rNr@)r5r6r7r2r8rrrCrCQrArrCc��eZdZeZy)� StreamWriterN�r5r6r7�bytes�charbuffertyper8rrrFrFU����NrrFc��eZdZeZy)� StreamReaderNrGr8rrrLrLXrJrrLc �l�tjdtttt t td��S)N�uuF)�namer r2�incrementalencoder�incrementaldecoder� streamreader� streamwriter�_is_text_encoding)�codecs� CodecInforr)r:rCrLrFr8rr� getregentryrW]s-�� � � � ���-�-�!�!�� � r)r4zi�r3) rUr �iorrr)r+r:rCrFrLrWr8rr�rYs�������,�*,�B(�F�L�L�(�0��2�2�0�0��2�2�0��5�&�-�-���5�&�-�-�� r